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

  • Home
  • SEARCH
  • 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 8149439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:51:08+00:00 2026-06-06T14:51:08+00:00

My task is I am having a inputFileLocation and list of some config files

  • 0

My task is I am having a inputFileLocation and list of some config files and need to check those files exists at that location.

  • Example: inputfileLocation = C:/input
  • list of config files: sample_a.conf, refund_a.conf, sample_b.conf, refund_b.conf

Need to check whether the file exists and then return the list of sample.conf files and list of refund.conf files.

How to achieve this in java ?

  • 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-06T14:51:09+00:00Added an answer on June 6, 2026 at 2:51 pm

    Pretty simple:

    import java.io.File;
    import java.util.LinkedList;
    import java.util.List;
    
    public class FileFinder
    {
        private String mInputFileLocation;
        private List<String> mSampleList;
        private List<String> mRefundList;
    
        public FileFinder(String inputFileLocation)
        {
            mInputFileLocation = inputFileLocation;
            mSampleList = new LinkedList<String>();
            mRefundList = new LinkedList<String>();
        }
    
        public void processList(List<String> filenameList)
        {
            for (String filename : filenameList)
            {
                File f = new File(mInputFileLocation, filename);
                if (f.exists())
                {
                    if (filename.startsWith("sample_"))
                    {
                        mSampleList.add(filename);
                    }
                    else if (filename.startsWith("refund_"))
                    {
                        mRefundList.add(filename);
                    }
                }
            }
        }
    
        public List<String> getSampleList()
        {
            return mSampleList;
        }
    
        public List<String> getRefundList()
        {
            return mRefundList;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm newbie for python, I'm having task so I need to scan wifi and
I'm having some trouble doing a very simple task. I have a rich textbox
I'm having difficulty doing this seemingly simple task. I want to load XML files
I'm having a problem relating to Sharepoint workflows and the associated task list. I
I'm trying to accomplish a task, but having some difficulty.Can someone set me straight
I am trying to create a task list with each task having a datetime
I'm having trouble coding a simple task for loop. What I need for the
I'm having trouble understanding my error Method: public List<Task> GetAllTasks() { var AllTasks =
Am having the task like in UITableView, In root view i have country list
I am having trouble doing this simple task of changing my input box color

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.