Twisterz
Twisterz

Reputation: 424

Accessing directories in Unix using Java

I tried Googling but was unable to come up with any results. What I'm looking for is a basic explanation or tutorial on howto navigate a Unix server with Java.

I have several Java programs that I would like to run directly on my server, however I just have no idea how to let these programs go to certain directories, or scan certain files, etc.

How exactly can I use Java with Unix?

Upvotes: 0

Views: 1662

Answers (3)

Alexander Pogrebnyak
Alexander Pogrebnyak

Reputation: 45576

To make your life easier use Apache commons-io FileUtils -> http://commons.apache.org/io/api-release/org/apache/commons/io/FileUtils.html

Here is the project home page -> http://commons.apache.org/io/

Upvotes: 1

John B
John B

Reputation: 32949

Use File. Specify a path, see if it is a directory, open it, read it, delete it, etc, etc, etc.

listFile will give the files within a directory.

Upvotes: 2

Related Questions