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 8458475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:05:28+00:00 2026-06-10T13:05:28+00:00

I am creating a directory traversal application for sorting emails. It is a very

  • 0

I am creating a directory traversal application for sorting emails. It is a very simple app for my specific needs.

I would like to implement this by first traversing all the email files (there are 1000’s of them in a few directories) and make new directories based on the sent/received information inside the eml files (The sent or received name used will be decided based on a constant).

I was thinking something like this

public FileVisitResult visitFile(Path file,BasicFileAttributes attrs) {
    email = getEmail(file);
    emailSentRcievedName = sentRecievedName(email);
    dirArray[currentDir + "\" + emailSentRecievedName] = file.get();
    return CONTINUE;
}

The dirArray key:value will be used for the file moving implementation.

I know this array structure would work in Javascript but how would I implement this in Java?

Cheers.

  • 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-10T13:05:29+00:00Added an answer on June 10, 2026 at 1:05 pm

    Try using a hashmap. It gives you the ability to store pairs of data

    Map<String,File> map = new HashMap<String, File>();
    map.put(currentdir +"/"+ emailSentReceivedName, file);
    
    File file = map.get(path); //will give you the file
    

    Also take a look at this: SortedMap, maybe it helps you
    http://docs.oracle.com/javase/1.4.2/docs/api/java/util/SortedMap.html

    Javadoc api here: http://docs.oracle.com/javase/1.4.2/docs/api/java/util/HashMap.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When creating gems, I often have a directory structure like this: |--lib |-- helpers.rb
I'm write installer for my web site. Installer creating application pool, virtual directory and
My app is creating a directory so that I can store log files in
I have a String like this D:/Data/files/store/file.txt now I want to check ,is directory
This is specific to creating a logfiles. When I am connecting to a server
I've found this way of creating a directory if it does not exist. But
It looks like this question is pretty simple but I can't find the clear
So I have this code creating a fake directory Options +FollowSymLinks RewriteEngine On RewriteCond
I'm developing a simple application for Android devices. I need to create a directory,
In my app, I used this code: File DirectoryPath = cw.getDir("custom", Context.MODE_PRIVATE); While creating

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.