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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:08:53+00:00 2026-06-04T12:08:53+00:00

I am currently creating a directory based on file names and then moving the

  • 0

I am currently creating a directory based on file names and then moving the files into the new directories. At the moment i am creating the new directories fine using the following code:

String filename = filesInFolder.get(i).toString();
File fullPathFile = new File(filename.replaceAll("(\\w+)_(\\d+).*", "$1/$2/$0"));
fullPathFile.getParentFile().mkdirs();

Then i am trying to use InputStream and OutputStream to move the files to the new directories, the code is ok it seems but when i create the new directories, all the folders are set to read-only so i cannot move the files into the knew directories

So is there a way to set the folders to read-write when they are created?

  • 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-04T12:08:54+00:00Added an answer on June 4, 2026 at 12:08 pm

    I believe fullPathFile.getParentFile().setWritable(true) before calling mkdirs() should do.
    The method setWritable (bool) is a convenience method to set the owner’s write permission for this abstract pathname.
    Since is a File, you can apply it.

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

Sidebar

Related Questions

I am currently trying to zip all files within a directory. The zip file
im currently creating a graph for an app, using coreplot and have a problem
I'm currently creating a user interface using WPF and would like to display a
I've got my mind set on dynamically creating URLs in Django, based on names
I am creating a htaccess file, I currently have a long url looking like
I have a solution that contains an ASP.NET Web Site (file-based) project. I'm currently
We are currently creating an InfoPath 2007 form is deployed in SharePoint 2007. In
I am currently creating a Perl module for in house use. I used ExtUtils::ModuleMaker
I'm currently creating a Flash CMS via Flex and the Zend Framework. In the
I am currently creating a type of classifieds website, and when the user enters

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.