name 1 « File Attribute « Java I/O Q&A





1. Accents in file name using Java on Solaris    stackoverflow.com

I have a problem where I can't write files with accents in the file name on Solaris. Given following code

public static void main(String[] args) {
    System.out.println("Charset = "+ Charset.defaultCharset().toString());
 ...

2. What is the best way to generate a unique and short file name in Java    stackoverflow.com

I don't necessarily want to use UUIDs since they are fairly long. The file just needs to be unique within its directory. One thought which comes to mind is to use File.createTempFile(String prefix, ...

3. Alternative to javax.activation.MimetypesFileTypeMap().getContentType(filename);    stackoverflow.com

I have some code:

import javax.activation.MimetypesFileTypeMap;
...
..
.
String filename = "foo.xls"; // Where this can be any file name .doc, .pdf or whatever

String headerContentType = new MimetypesFileTypeMap().getContentType(filename);
It seems javax.activation.MimetypesFileTypeMap class is inside rt.jar ...

4. Create a Spooled File from Java with a specified Job name on iSeries    stackoverflow.com

Is there a way to specifiy the JOB name when creating a spooled file? So that my created s.f. doesn't have the default "QPRTJOB". My method that creates a spooled file with the ...

5. How to create tmp file name with out creating file    stackoverflow.com

I write application in Java using SWT. I would like to create unique file name. But I do not want create it on hard drive. Additional functionality: I want to create ...

6. Java: Problem With Greek File Names (non-latin file names)    stackoverflow.com

Using Java: I am reading a directory containing files with Greek Names. But when i output a String containing a file name i get this '???????.something'. Is it because i am running ...

7. Getting the used file name from a Properties instance    stackoverflow.com

An instance of java.util.Properties is passed to me which has been created using:

[...]
properties = new java.util.Properties();

try {
  properties.load(
    AutoProperties.class.getClassLoader().getResourceAsStream(propertyFile)
  );
}
[...]
I was wondering how I could retrieve ...

8. getting ghostscript to take in files with spaces in their name (like something in "my documents")    stackoverflow.com

I'm trying to run this command to use ghostscript (from java) but Whether with single quote ' or " or nothing at all I get an error

Error: /undefinedfilename in ('c:\\Documents)


gswin32c.exe -q ...

9. fileName or filename?    stackoverflow.com

Possible Duplicate:
Parameter naming: filename or fileName?
What do you use - filename or fileName? The classes in the JDK use a lower case 'n', ...





10. Identifying OS-dependent invalid filename characters in Java 6 (not 7!)    stackoverflow.com

Right now we've got a hard-coded set of characters that we check for -- :*?"<>|/\ -- basically the ones Windows complains about. However, running on Linux, this is way too restrictive. I ...

11. get a different file name    stackoverflow.com

How do i get a different file name on a webserver by requesting the url. for example "file" click url link and get "file.bin" the "file" is located on a webserver by ...

12. Get the name of all attributes in a XML-File    stackoverflow.com

Hey I have an XML file and I would like to navigate to a given node and grab the name of all Attributes to that node. For example: ...

13. International characters in filename in mutipart formdata    stackoverflow.com

I am using Apache HTTP components (4.1-alpha2) to upload a files to dropbox. This is done using multipart form data. What is the correct way to encode filenames in in a ...

14. doubt in file name    stackoverflow.com

what is the difference b/w abstract pathname and pathname string. I came across these two when i was reading about string separator

15. Getting the drive name in Java    stackoverflow.com

I'm making a basic file browser, and in one mode, it loops through the file roots and lists them. I have it get the icon, drive letter, last-modified date, drive name, ...

16. Does Java IO have a maximum file name length?    stackoverflow.com

Different operating systems have different file name max lengths. Does Java have any limit on file name length when working with files?





17. Java filename expansion library    stackoverflow.com

I'm looking for a Java library that helps resolve file paths, for example a library that would do something like:

String abs = Files.expand("$HOME/.bashrc")
or
String abs = Files.expand("~/$OTHER_DIR/../file")
and resolve those to a file ...

18. How to create multiple files, generating a random name for each file    stackoverflow.com

What I'm trying to do is create lots of random files but I'm just completely lost. The code below just doesn't work, I'm wondering why it doesn't work and what can ...

19. Need help about "Get Attachment File Name" Tutorial from Java2s.com    stackoverflow.com

i try the tutorial Get Attachment File Name from Java2s.com. What i'm doing is to read email from the Outlook Web Access Light. If i put the url address of the Outlook Web ...

20. in java using asterisk and question marks to match the name of a file    stackoverflow.com

I want to write in java something like this:

public class MyMatcher 
{
   public static boolean isMatching(String filename, String param) { 
      ...
  ...

21. Unique File name using system time? in jAVA    stackoverflow.com

I want to use unique id for the files. How can I use system time to generate unique IDs in jAVA? Thanks!

22. java: new File("", "name") != new File("name") ? (file constructor with empty string)    stackoverflow.com

Noticed this today. Given that a file named "existing" exists in the PWD of a java process (windows).

new File("existing").exists() => true
new File("", "existing").exists() => false
new File(".", "existing").exists() => true
I would ...

23. JVMTI get name of called Class/File    stackoverflow.com

I tried to read through the whole jvmti documentation and I didn't find a solution for my problem. I want to get the name of the class/file that is used in the ...

24. How do I correctly set the HTTP Content-Disposition for large file names in Java?    stackoverflow.com

I'm working on some requirements that will lead to arbitrary PDF files being downloaded from a J2EE web server. The names may look like this:

Xxxxxxxxxxxxxxxxxx - Yyyyyyyyyy - Aaaaaaaaaaa ...

25. Indexing file names in java    stackoverflow.com

I am trying to index multiple file names (.txt) in an array. for example static String[] filename = new String[40]; and I have 40 files in the project directory. I want to ...

26. Scp file with jsch gives 'unexpected filename'    stackoverflow.com

I'm using Jsch 0.1.44 to scp a file from one host to another. The relevant code is the following:

public boolean transferFileToHost(File fileToTransfer, String destDirectory, String destFilename) {
    Channel ...

27. String used for a file name has escape character "\". How do I get around this?    stackoverflow.com

PrintWriter out = 
 new PrintWriter("C:\Users\Slerig\Desktop\gnuplot\binary\cannonballOutput.txt");

This is my sample code. It is quite simple. It throws a "Invalid Escape Character" error because of the backslashes. How do I get around this? ...

28. Display file name in println    stackoverflow.com

I am trying to figure out how to display my file name in the println the the following code using the file object properties. I am new to this and ...

29. Proper Names    coderanch.com

30. Getting the name of Protocal    coderanch.com

Hi Peter, This is my first visit to this Tremendous Informative site. My Question is Can we get the name of the Protocal (Http, ftp, file, etc.) running on our system. for eg. If a user/Administrator which is collecting his information or transferring his information and if he uses some protocal(like http if he/she uses Servlets or any other), Is there ...

31. Long file name problem...    coderanch.com

Hi Guys, In my application, I am opening a file from its location but it doesnt work if the file is in My Document or Program Files like that...so How do I take care of the long file names even it doesn't support the file name with spaces.. Any help would be appriciated !! thanks Pratik

32. Long File name    coderanch.com

I am trying to open a file from my application by passing the filename as a string parameter here is the code for that.. import java.lang.Integer; import java.io.*; public class OpenFile { public OpenFile(String fileName) { String FileName=""; FileName=fileName; String Path=""; FileName=FileName.toUpperCase(); String osName = System.getProperty("os.name" ); Path="Start " + fileName; if( osName.equalsIgnoreCase( "Windows NT" ) | | osName.equalsIgnoreCase("Windows 2000" )| ...

33. Colon in FileName    coderanch.com

Colons used to be file separators for Mac OS. The new OS X uses the slash as a file separator (like other Unices), but I think it may still allow the colon as a file separator, for Classic and Carbon stuff, I'm not sure. So, yeah, it's a file separator. What are the legal characters in a filename in Java? I ...

34. Getting all file names on a hard drive...    coderanch.com

I'm trying understand the most efficient way to build a Collection ontaining all of the absolute path names of all files on a hard drive. I understand I have to iterate through each directory starting with the root, or "\" in a MS-WIndows box, however, list seems too easy! Am I missing something? Marcus [ January 10, 2005: Message edited by: ...

35. Filename selection window    coderanch.com

I have a jsp form in which I want the user to enter a fully qualified filename (to later link to). But it would be better to pop up the file select window and let them select the file. Any ideas? I assume if I'm doing jsp's I don't want to get into Swing too. Thanks, Dana

36. getting a filename    coderanch.com

I have to make a database of an mp3 collection where all the mp3's are actually .txt files with nothing in them. I have to put them in some kind of collection which shouldnt be a problem for me. The problem is that I don't know how to get the file and folder names themselves in order to add them to ...

37. Uploading/Downloading Problem(For Japanese Filename)    coderanch.com

I'm using Apache commons.net API for FTP file Upload\Download. The program(given below) is working fine(i.e uploading\Downloading)for ENGLISH Filename.But while Uploading/Downloading Japanese Filename the file name get junk..(i.e ???.txt) Please suggest some solution:: import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.SocketException; import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTPClient; public class FTPPutUpLoad { public static void main(String[] args) throws IOException { FTPClient ftp = new FTPClient(); ...

38. How to get the filename of the java file ?    coderanch.com

Hey all, How can I retrieve the "filename" of the "current" file in which my java code resides. That is, I have a java source file - "abc.java" on some "c//xyz//" path. I want to pass the filename "abc.java" to a String during the execution of code. Could this method be applied inside a scriptlet in a JSP file too? Roger ...

39. Unable to view the file through application because of file name with spaces    coderanch.com

I am using file upload in my application.I have uploaded a file in my local folder say in D: whose name contains more than 1 word separated by spaces(Ex.file upload.txt).The file is saved successfully in the physical path.If I am trying to view this file through application ie.by clicking a link or by clicking the button,File not Found Exception is coming.Will ...

40. Case-sensitive of filename    coderanch.com

Hi, I wish to download a text file from a remote server. As Unix is case-sensitive, is it possible to download a file regardless of the case-sensitivity of its filename? That means if the server store this file named "ABC.TXT", so even if I input "abc.txt", I can still download the file. Thanks to advise if you have some solution.

41. Get Sheet name dynamically from a MS-Excel file    coderanch.com

Hi, I want to get all the sheet name from a ms-excel file dynamically using java and JDBC connection. I can get the excel values but now i am hard coded the sheet name. Instead of that i have to get the sheet name dynamically by passing the file name or path. Please help me out from this query. Thanks Mohan ...

42. random file name    coderanch.com

It should be done on a server so maybe it is more about servlets. it is two questions: 1. I wonder if there is already something in java for creating random strings at length n. I need them for creating random file names. If i should do it myself, is there anything in java to help with it or should I ...

43. File Name Problem    coderanch.com

Hello, I am real confused with a small issue with the file uploading part.when i upload a file say ImportantDocument.doc it gets uploaded correctly ,but the file name is changed to all smaller case like importantdocument.doc.This happens with almost all files which are uploaded.Please advice me on this . I am hereby pasting my file handler method for your perusal.Please advice ...

44. How to open/execute files with unicoded fileName?    coderanch.com

Hi all, I'm trying to open a file with unicode in fileName (Cyrillic or Chinese characters) from Java(JDK 1.4.2) on Windows XP I have tried encoding the url to UTF-8 etc... but nothing seems to work final String browser ="cmd.exe"; final String FIRST_WINDOWS_PARAMETER = "/c"; final String SECOND_WINDOWS_PARAMETER = "start"; final String THIRD_WINDOWS_PARAMETER = "\"\""; // for titles with spaces to ...

45. jdk1.3 and file name case insensitive    coderanch.com

Actually, I am hoping somebody will let me know about the other command lines. Filename case insensitive isn't the only oddities in jdk1.3. Recently, it has been reported in "Cafe au lait" website that the "main" method does not need to be public! At this point, I am not sure these are bugs or some unreported changes. Hopefully, they are bugs ...

46. Japanese filename coming s junk    coderanch.com

47. fileupload- default file name    coderanch.com

You need to send in the 'default' name as a hidden field. Because the request object does not guarantee the order in which you can pull off the parameters, you'd need to upload the file to a temporary directory. Then when you have the filename, use the Java file i/o classes to move/rename your file.

48. Filename attribute for Inline Content-Disposition Meaningless?    coderanch.com

Hi Juanjo, ... I don't think u get me. What I'm trying to know is whether we can set the default file name programmatically, depending on the type of document. response.setHeader("content-disposition", "attachment;filename=hello.pdf"); If we are using attachment (above), the default file name would be as the one we set in the "filename" attribute. But this method always prompt us the "open" ...

49. how to keep the filename when client opens a streamed file in browser?    coderanch.com

When streaming an excel file to client, how to let client opens it directly in IE without losing the filename I specified? I am writing a struts webapp. When user clicks a particular button, the html form will be submitted to http://mydomain.com/mywebapp/getreport.do. An excel file will then be streamed to user. User can choose to open it directly in IE, or ...

50. bundle, in one config file, web parameter names?    coderanch.com

Let's assume a typical Java web application, with a data entry jsp, a query jsp, and an output jsp, together with some kind of query Bean that transfers parameter values between these jsp's and the business objects. Let's assume that the list of parameters passed to and from these pages and objects remains the same. A book ordering catalogue page might, ...

51. getResource(fileName)    coderanch.com

Hi In my program I am making a call as ClassLoader.getSystemClassLoader().getResource(fileName) If I try the above method with the filename as viewing.proprties and that file resides in c:\program files\ Then This is the error I get : ------- Error ---------- url = file:/C:/Program%20Files/viewing.properties java.io.FileNotFoundException: C:\Program%20Files\viewing.properties (The system cannot find the path specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:106) at java.io.FileInputStream.(FileInputStream.java:66) at TestFile.getProperties(TestFile.java:79) ...

52. Java File Name details    coderanch.com

Actually In java The Filename should match with the Public class inside that filename, Not with the class which has main method. This is a requirement of the Java reference compiler released by Sun. And this is the reason what I found on SDN network, which says it's in the JLS. Section 7.6: "When packages are stored in a file system ...

53. Grabbing File names only    coderanch.com

Is it possible to just grab a file name, and turn it into a String to be used in another place in code? What I am trying to do is allow the user to select the file they want to convert from XML into one of our document formats. Since you have to run the actual conversion command through DOS, i ...

54. How to create the unique file name?    coderanch.com

Every time when the client programs runs, it has to create a file to log the message. If it creates a file with the name say, "LogMsg", then sometimes from the same machine, if two requests are shooted, then the contents of that file will be overwritten or it can be appended (for each request). Instead of that, i want to ...

55. why .java filename constraint ?    coderanch.com

56. Suppling the name of the file    coderanch.com

57. file name loop    coderanch.com

Thanks for the info. class test { static File file; public static void main(String[] args) throws IOException { BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); String filename=null; do{ System.out.print("Please enter filename: "); filename = stdin.readLine(); File file = new File(filename); }while (!file.exists()); } } The problem I run into now is a Null pointer exception. If I surround the loop with a ...

58. name of java file    coderanch.com

>> every java source file can have at the most one public class per file? Incorrect. There is no such requirement. Moreover, there is no requirement that you use files at all. This is a common misconception but as a practical matter, most Java compilers insists on this restriction to speed up compilation when looking for depencencies. Is there a practical ...

59. Name Of file !!!    coderanch.com

public class stack { private int stck[]; private int tos; // initialize the stack stack( int i) { stck = new int[i]; tos = -1; } void push(int i) { if(tos >= stck.length) System.out.println(" Stack Overflow/stack is full "); else stck[++tos] = i; } int pop() { if(tos < 0) { System.out.println(" Stack underflow "); return 0; } else return stck[tos--]; ...

60. file names    coderanch.com

61. Java File Name    coderanch.com

No real reason; it's actually not even a real rule, just an optional rule that may be enforced by the implementation. The very first Java compiler did it to make it easy to find the source code for classes it hadn't compiled yet; other compilers have followed in its footsteps. But don't expect anything fancier than that.

62. Prompt for file name    coderanch.com

Originally posted by Luigi Melanson: .... prompt for a file name instead of predefining "filein.txt" in the code Any help would be appreciated, I Think I understand what you are wrestling with here. The cite Marc Weber provides is certianly something you need to keep on your list, but the problem is asking the user for a filename then reading that ...

63. Spliting a file name    coderanch.com

I am writing a program that that reads a file of .gif images and stores them. It has worked well, until lately, a file called Thumbs.db gets read in, even through Windows explorer can not find it, even with searching hidden files as well. Does anyone know what this file is and how to delete it completely, and keep it from ...

64. substring of file name    coderanch.com

hello I am trying to get a substring of a file name and I need in specific place. the name is OS_inshp1_2_6775863_1188132465113_(OS_L_inshp1_292_1188132343)_load.xip and I would like to know what is the command to get only what in between () meaning, to run up to the '(' sign, get the name inside until getting to ')' sign. thanks for the help

65. Cannot get the complete filename    coderanch.com

66. file name    coderanch.com

it is said that the name of the program file shuld be d same as the public class in d program if any and if there is no public class then the program file can have any name. but wen i tried the latter option it gives a runtime error y so??

67. Get Filename using substring    coderanch.com

Niki Nono was nearly correct; you look for the path separator and file separator. But you don't have to search far for them; there are fields in the File class called separator or pathSeparator which encapsulate that information, so you can find the last index of those characters. You can also find them from the System class. Look through the File ...

68. Java program file name question    coderanch.com

69. Chinese Filename    coderanch.com

[Ulf]: Java strings are in Unicode - is the console capable of displaying Unicode? Internally a String is stored in Unicode. However when it's written to a console, it's generally converted to the platform's default encoding. For some encodings it's impossible to represent some characters, e.g. it's impossible to represent most all Asian characters in ISO-8859-1. However for a machine configured ...

70. Corrupt file name after compression.    coderanch.com

I am using the following code to zip a file with name as shown in attachment. The file name consist of spanish characters. After compression file name is different an some characters are shown as +- as shown in attachment. Can any body tell me how to resolve it? import java.io.*; import java.util.zip.*; public class Zip { static final int BUFFER ...

71. ansi vs utf8 characters in filename    coderanch.com

Hello I just don't know where to look for an answer on this: I'm developing a program which generates a file, whose name is extracted from another file, which holds a list of names. For instance, suppose the word voil is extracted from the source file, then the new file name is: voil.txt The thing is, if I run the program ...

73. Cannot create file with certain name    coderanch.com

I am working on an app and basically need to create a file with the following format.... log_dd-MM-yyyy_HH:mm.txt However, i am not able to do it..and the namefile i get is of this format log_dd-MM-yyyyHH (without the extension) This is my code... It apperas that the : is habing problems in the getTime() because if i use a . instead of ...

74. looping on files ordered by file name    coderanch.com

Hi there , I scan several papers and give them a name of 0.jpg, 1.jpg, ordered by numbers and then add them to a pdf file by the order of their names , sometimes the created pics bypass a number such as 0.jpg, 1.jpg, 3.jpg, 4.jpg 2.jpg in examples was lost so when looping on it error appear before completing the ...

75. Finnish/Swedish characters in the FileName    coderanch.com

I am not forwarding the request to the web page. From servlet itself i am returning the file to the user, which gives the option of saving or opening of the file. And on saving the file the fileName gets converted to junk characters. I think if i forward the request to a jsp and then perform URLencoder.encode() on the filename, ...

76. What will be the name of .java file?    coderanch.com

How the source file should be named does not have anything to do with whether the class has a main method or not. The rule is simple: You can have only one top-level public class per source file. If you put two top-level public classes in the same source file, you will get a compiler error. There is no way around ...

77. how to get filename from fullpath    coderanch.com

78. Creating file names in Java using MultiLingual charcters    coderanch.com

Hi Friends, I am developing a web-app, where the application enables user's to download reports from the site, I need to create name of the downloaded report from the web-site as a russian name rather than english one, I tried storing the name as a value in the DB, I am able to retrieve and display the name in russian on ...

79. Merged files? (can't think of a better name)    coderanch.com

Say I have an image file that's a spritesheet. and I have a text file with the indexes and locations of each sprite on the spritesheet. How could I merge those two into one and when I read the file I can re-read the image and the indexes? Or for example: games like starcraft have their soundeffects packed into a single ...

80. file name matters ?    coderanch.com

I write a java code to parse some comma separated file. If I name the input file as "xx.txt" or "xxx.csv" it works fine. What if I name is as "xxx.txt-some-weird-ending-name", does it matter ? I tried it seems fine but I want to know if there is any fundamental issue with it.

81. file name issue    coderanch.com

83. File Name Too Long    coderanch.com

The actual problem happens in a web application when system encrypts a file name and tries to store it on server. I have extracted the root cause of that problem and illustrated it in that code. So crux of the matter is I want to be able to handle file names more than 256 characters using Java File Handling. Is it ...

84. Java internationalization question: Chinese file name display is grabbed in browser    coderanch.com

I met an issue that when open a file with Chinese name in our application, the popup window ( see attachment) is not able to show Chinese Character, It shows "---" or " __" or "???" depends on diferent browser and OS (Windows and Linux). The attachment is list the error popup window in IE8 (Chinese character is shown as __) ...

85. String to file name    java-forums.org

Apart from a command-line argument, can I ask a user to input the name of a .txt file which can then be read by the program? I have tried, for example: System.out.print("Enter the file name, eg, NameOfFile.txt"); Scanner myScanner = new Scanner(System.in); String myFile = myScanner.next(); Scanner diskScanner = new Scanner(new File(myFile)); // this line doesn't work.. Can I get the ...

86. New filename after try catch    java-forums.org

I cannot figure out how to ask the user for a new filename, after the computer throws a FileNotFound error at the end of my try catch block. I need to ask the user for a string filename. create a Scanner called input with that filename (must use try catch) if the file doesnt exist, I need to reprompt the user ...

87. filename as a string    java-forums.org

hi.... is it possible to get a file name as a string..Im choosing a text file with a file chooser. the selected file name should be stored in a string.. wat s the command to convert the file object to string. Java Code: boolean openFile() { JFileChooser fc = new JFileChooser(); fc.setDialogTitle("Open File"); // Choose only files, not directories fc.setFileSelectionMode(JFileChooser.FILES_ONLY); // ...

88. Java File name with white space    java-forums.org

89. Different file name    forums.oracle.com

Hello all, can anyone pls give me an idea of how to do this: When i create a file, it has a name that its by default. But if i run my app again the file will be overwritten. I want to know how to create a new file with the same name, but with a number that makes it different ...

90. IgnoreCase filename    forums.oracle.com

91. How to create a new file having a name that is stored in a string    forums.oracle.com

The Java Almanac example I linked to uses createNewFile() - the API documentation is not particularly clear about exactly what happens if c:\some\value\assigned\at doesn't already exist. But you're only a small experiment away from finding out! Another page gives examples of directory creation. http://www.exampledepot.com/egs/java.io/CreateDir.html Once (or if) the file is created using a File then, yes, that File is the name ...

92. Language: Filename with characters for arabic turns question mark    forums.oracle.com

Language: Filename with characters for arabic turns question mark OS: Solaris 9 Machine: Sun-Fire 25K There is an adobe distiller software that is configured and a java apps. There are postscript files that are being converted to .pdf format using the adobe distiller. Using the GUI (using the Exceed; for remote access), when they use GUI to convert the postscripts to ...

93. dynamic file name    forums.oracle.com

94. Passing a file name    forums.oracle.com

In my application, 1. the main() takes a file name as input. 2. There is a method in my class that needs to access the file. 3. I am currently trying by passing the name of the file as the string to that method. 4. Code is not compiling. My question is, where am I going wrong? Do I have to ...

95. filename    forums.oracle.com

96. how to add another output file for names with 5 letters? HELP needed!!! =]    forums.oracle.com

public static void main(String[] args) throws IOException { int ch; Scanner sc = new Scanner(System.in); System.out.println("Enter the input file name: "); String fileName1 = sc.nextLine(); System.out.println("Enter the output file name for names with 5 letters or less: "); String fileName2 = sc.nextLine(); BufferedReader brStream = new BufferedReader (new FileReader(fileName1)); PrintWriter pwStream = new PrintWriter(new BufferedWriter(new FileWriter(fileName2))); System.out.println("The file contains:"); String aString ...

97. Wildcard support in File names    forums.oracle.com

98. Filename problem    forums.oracle.com

99. Trouble Getting Filename    forums.oracle.com

If you look at the File class in the API you will see that it has no constructor that takes a URL as a parameter. It does have one that takes a URI or just a plain ol' String representing the path. P.S. Never change your method to static "just to make it work". Understanding why you get that error and ...

100. I can't create filename "AUX"    forums.oracle.com