Skip to content
Advertisement

Tag: file

How to sort file names in ascending order?

I have a set of files in a folder, and all of them starting with a similar name, except one. Here is an example: I am able to list all the files from the specified folder, but the list is not in an ascending order of the spectrum number. Example: I get the following result when the program is executed:

Using BufferedReader to read Text File

I’m having problems with using the BufferedReader I want to print the 6 lines of a text file: Now from what I can gather every time I call the readLine() method it automatically advances to the next line. So I can’t use the condition br.readLine() != null since it’ll already advance it one line and I get the output: What

How to create my own file extension like .odt or .doc? [closed]

It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago. The community reviewed whether to reopen this question 1 year ago and left

Setting file permissions returns FALSE always

The code: On Ubuntu all 3 calls return false. On my Windows only the 3rd call to setWritable returns false. The target is to create the file/dir so the user (tomcat) and the group will be able to read/write. BUT the file created on Ubuntu without permissions for the group to write. Answer I found the solution and will answer

Delete all files with an extension using Java

I’m (relatively) new to Java and I’m trying to implement a .jar that runs a list of commands that in Windows XP’s command prompt it would be: My (failed) attempt: I screwed somewhere around that “get(i)”, but I think I’m pretty close to my goal now. I ask for your help and thank you very much in advance! EDIT Alright!

Android : How to read file in bytes?

I am trying to get file content in bytes in Android application. I have get the file in SD card now want to get the selected file in bytes. I googled but no such success. Please help Below is the code to get files with extension. Through this i get files and show in spinner. On file selection I want

Eclipse – Show generated class files

How can I show the folder (bin) where my class files are placed after I build a project in eclipse? I want this directory to show up in the package explorer. Searched the forums, but can’t seem to find an answer Answer You can view the the bin folders in the Navigator (Window –> Show View —> Navigator), which is

Access file in jar file?

I need to be able to access a file stored in a compiled jar file. I have figured out how to add the file to the project, but how would I reference it in the code? How might I copy a file from the jar file to a location on the user’s hard drive? I know there are dozens of

Advertisement