Java File class substitute?

oorosco

New Member
Reaction score
23
Hi i need a way to "look" at files/folders, not actually change them but basically i need a way to read through them for a java project.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Code:
try {
			fileInput = new Scanner(new File("somecoolfile.txt"));
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

Then you can go to town or so....

Code:
while(fileInput.hasNext())
		{
                        int foo = fileInput.nextInt();
			System.out.println(foo);
		}
 

UndeadDragon

Super Moderator
Reaction score
447
Or another method would be to use BufferedReader (You can use BufferedWriter if you wanted to change anything).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top