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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:34:29+00:00 2026-06-04T19:34:29+00:00

Windows treats libraries differently from regular folders and paths. Thus when I use this

  • 0

Windows treats libraries differently from regular folders and paths. Thus when I use this block of code to create a text file:

File filePath = fc.getSelectedFile();

… More irrelevant stuff…

File outputText = new File(filePath.getParentFile(), "Decrypted.txt");

    try
        {
        FileWriter fw = new FileWriter(outputText); //Write everything to the file.
        fw.write(messageOut);
        fw.close(); //DON'T FORGET TO CLOSE THE FILE!
        }
    catch (IOException e)
        {
        // TODO Auto-generated catch block
        e.printStackTrace();
        }

It works if the file is in, say, the Desktop folder, but if I try to put it in the My Pictures Library, I get this error message:

java.io.FileNotFoundException: ::{031E4825-7B94-4DC3-B131-E946B44C8DD5}\Pictures.library-ms\Decrypted.txt (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileWriter.<init>(Unknown Source)
at code.Crypto.decrypt(Crypto.java:57)
at code.Crypto.main(Crypto.java:27)

Is there a way for me to fix this?

  • 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-04T19:34:31+00:00Added an answer on June 4, 2026 at 7:34 pm

    Looks like a bug, tested and confirmed on my system as well with java 7 update4 32bit.

    JFileChooser fc = new JFileChooser();
    int returnVal = fc.showSaveDialog(null);
    //select and enter a name for a file under libraries (with windows look and feel 
    //select 'desktop' in the left pane, then libraries->pictures)
    if (returnVal == JFileChooser.APPROVE_OPTION) {
        File file = fc.getSelectedFile();
        FileWriter fw = new FileWriter(file); //<-- FileNotFoundException
        fw.write("foo bar");
        fw.close();
    }
    

    Exception:

    Exception in thread "main" java.io.FileNotFoundException: ::{031E4825-7B94-4DC3-B131-E946B44C8DD5}\Pictures.library-ms\hej.txt (The system cannot find the path specified)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
    at java.io.FileWriter.<init>(FileWriter.java:90)
    at test.Main.main(Main.java:16)
    

    An ugly workaround could be to specify a file filter that filters out those, see:

    Selecting 'Computer' or 'Libraries' in Java's JFileChooser yields a strange File object

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

Sidebar

Related Questions

I'm using LuaInterface for .NET to create Windows Forms objects. This works pretty good
I have an Windows application treats Windows key events. The application conveys the Windows
Windows asks users to choose from about 200 timezones , when there are actually
Because windows line ending are actually two characters ( \r\n ), max_length treats them
I'm attempting to use signals/slots with large integers ranging from 0 - 2^32-1. I've
My combobox returns a set of values from s stored procedure as this private
Windows Phone 7.1 supports SQL Server CE and LINQ to SQL, as well as
Windows Mobile 6.x is based on Windows CE 5.x and it doesn't have CDFS
Windows vista 32 bit - C# - .NET 4 - sqlite - IIS 7
Windows form application. C# 4.0. Basically I have two datagridviews dgv1 and dgv2. One

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.