Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  File questions (Java 6)  (Read 1291 times)
0 Members and 2 Guests are viewing this topic.
Offline zammbi

JGO Strike Force
***

Posts: 963
Medals: 9



« on: 2010-11-07 02:14:46 »

I'm currently working on building a Java file browser but got  a little stuck.

1) I couldn't Figure out how to get special folders (libraries, recent files, network). These are in the JFileChooser.

I read that you could get them by :

File[] cbFolders = (File[]) sun.awt.shell.ShellFolder.get("fileChooserShortcutPanelFolders");
or
File[] cbFolders = (File[]) sun.awt.shell.ShellFolder.get("fileChooserComboBoxFolders");

But these return garbage folders and nothing what I want (well 'fileChooserShortcutPanelFolders' returns 'recent' folder).
Yes I know these sun.* class files but I want to have special folder support in Oracle Java (work out mac/etc later).

Seems Commons VFS doesn't like these files. So might have to ask for help over there.

2) Any way to work out what is a system file/folder? I could check for .sys for one type of system files but doesn't help for the rest.
JFileChooser seems to hide these files(but still show hidden files), so there must be a way.


Current project - Rename and Sort
Offline zammbi

JGO Strike Force
***

Posts: 963
Medals: 9



« Reply #1 on: 2010-11-28 17:11:23 »

Quote
2) Any way to work out what is a system file/folder? I could check for .sys for one type of system files but doesn't help for the rest.
JFileChooser seems to hide these files(but still show hidden files), so there must be a way.
For anyone else that wants to know:
FileSystemView.getFileSystemView().getFiles(...) returns a set of files that are not system files and therefore don't need to check if its a system file.

Current project - Rename and Sort
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.071 seconds with 18 queries.