Added newFile(base, part, part, ...).
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2640 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -38,6 +38,20 @@ import static com.samskivert.Log.log;
|
|||||||
*/
|
*/
|
||||||
public class FileUtil
|
public class FileUtil
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Creates a file from the supplied root using the specified child components. For example:
|
||||||
|
* <code>fromPath(new File("dir"), "subdir", "anotherdir", "file.txt")</code> creates a file
|
||||||
|
* with the Unix path <code>dir/subdir/anotherdir/file.txt</code>.
|
||||||
|
*/
|
||||||
|
public static File newFile (File root, String... parts)
|
||||||
|
{
|
||||||
|
File path = root;
|
||||||
|
for (String part : parts) {
|
||||||
|
path = new File(path, part);
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursively delete the specified directory and all files and
|
* Recursively delete the specified directory and all files and
|
||||||
* directories underneath it.
|
* directories underneath it.
|
||||||
|
|||||||
Reference in New Issue
Block a user