Hi All,
Sorry this is offtopic. But I require a quick solution. Please help.
I recently had a problem while working with java, Windows 2000 platform. I
was trying to list out the files from a directory with the
listFiles(fileExtension) function. ( javax.swing.filechooser.FileFilter)
PROBLEM:
There is no problem if we are having small file names in the directory. But
if I create a file name in JAPANESE with length > 130, the listFiles returns
a file array while DOES NOT contain the file and the directory entries
following that.
Is there a work around for this problem? Why java is unable to read long
filenames in Japanese?
How can I list all files from the directory?
Here is the code that I wrote :
File file = new File( "E:\a\b\c") ;
FileFilter filefilter_ = new XAPFileFilter( ) ;
filefilter_.addExtension( newExtension ) ;
File children[ ] = file.listFiles( fileFilter_ ) ;
files = children ;
System.out.println( "Files are " );
int length = files.length ;
for( int i = 0 ; i < length ; i++ ) {
System.out.println("File " + i + " : " +
files[ i ].getName( ));
}
Regards,
Aravind.
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com