Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8238393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:47:55+00:00 2026-06-07T19:47:55+00:00

I want to write a Java application that validate files and directories according to

  • 0

I want to write a Java application that validate files and directories according to certain naming standards. The program would let you pick a directory and would recursively analyze — giving a list of files/directories that do not match the given rules.

Eventually I want the user to be able to input rules, but for now they would be hard coded. Oh, and this would need to be cross-platform.

I’m have a working knowledge of basic Java constructs but have no experience with libraries and have not had much luck finding demos/code samples for this type of thing.

I would love suggestions for what trees to start barking up, pseudo-code — whatever you feel would be helpful.

EDIT: I’m not trying to remove anything here, just get a recursive listing of any names that break certain rules (e.g. no spaces or special characters, no directories that start with uppercase) in the chosen directory.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T19:47:57+00:00Added an answer on June 7, 2026 at 7:47 pm

    I would like to use Commons IO, I think DirectoryWalker will help you.

    Here is the sample for checking and removing “.svn” dir

      public class FileCleaner extends DirectoryWalker {
    
        public FileCleaner() {
          super();
        }
    
        public List clean(File startDirectory) {
          List results = new ArrayList();
          walk(startDirectory, results);
          return results;
        }
    
        protected boolean handleDirectory(File directory, int depth, Collection results) {
          // delete svn directories and then skip
          if (".svn".equals(directory.getName())) {
            directory.delete();
            return false;
          } else {
            return true;
          }
    
        }
    
        protected void handleFile(File file, int depth, Collection results) {
          // delete file and add to list of deleted
          file.delete();
          results.add(file);
        }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write a java program that acts as a user interface to
I want to write a program (preferably in java) that will parse and analyze
I want to write an application in Java that will communicate with Google App
I want to create a hidden folder using java application. That program should work
I want to write an android application that can parse files. I have figured
Hello I want write my own desktop sharing application in Java. The application should
I want to write a java code that executes some Linux command: String cmd
I want to write an Android remote control application that allows people to navigate
I want to write a GUI seating application that allows users to draw and
I want to run a standalone java application on a remote server. It would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.