How to get a single file from a folder in java? -
The idea is to take a file, but I do not want to list all the files. I have the address of the folder specified, but the name is not.
Actually I want
findFileInFolder (string folder name) --- this method returns a random file name or created on the old file folder
Has anyone ever tried to do this?
Added:
In the case of the bus I was not clear (I'm doing) really sorry for my English. Please forgive me if I make a motivational or aggressive sound, in fact, this is not my intention.) File is not selected by any person, it is chosen without any request by the machine or showing the file string With filename
string fail infaller (string folder name)
As I am commenting about the use of RAM and processor because it is a secondary form Process and is not the primary of the project, so if I have to read one thousand files, which will greatly reduce the performance of my project: (
thanks;)
Update: The program is running on different computers, so I could simply access the directory that does not "think" about reading, which would be very good to file. = D
Hope is last updated: you are sorry to bother people :)
There is no way from the answers I read. My question is: Do you think that instead of doing an array, what would be the best option? I think creating an index in the text file and taking only the first line.
You can do this on class and
Will be able to filter for example according to their last modified date.
On one side of the note, why do you want to avoid the list of all files for performance issues?
Comments
Post a Comment