Modifier and Type | Field and Description |
---|---|
static String |
GIF
A file extension.
|
static String |
JPEG
A file extension.
|
static String |
JPG
A file extension.
|
static String |
TIF
A file extension.
|
static String |
TIFF
A file extension.
|
static String |
TXT
A file extension.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
delete(File file,
boolean recursivly)
Deletes (optionally recursivly) the specified file or directory.
|
static String |
getExtension(File file)
Gets the extension of a file
|
static File |
getFile(File parent,
String... paths)
Gets a file from path names.
|
static File |
getFile(String... paths)
Gets a file from path names.
|
static String |
getFirstName(File f)
Gets the first name of a file (from start to the first point).
|
static String |
getName(File f)
Gets the name of a file (from start to the last point).
|
static String[] |
getPathNames(File path)
Gets the path names of the specified path.
|
static File |
getRoot(File file)
Get the root of an absolute file or directory.
This will be always true: path.equals(Files.getFile(Files.getRoot(path), Files.getPathNames(path)) |
static String[] |
readLines(File file)
Reads the lines from a text file.
Return type may change to List<String> in future!? |
public static final String JPEG
public static final String JPG
public static final String GIF
public static final String TIFF
public static final String TIF
public static final String TXT
public static String getExtension(File file)
file
- the file whose extension should be fetchedpublic static String getFirstName(File f)
f
- the file whose first name should be fetchedpublic static String getName(File f)
f
- the file whose name should be fetchedpublic static String[] readLines(File file) throws FileNotFoundException, IOException
file
- the text fileFileNotFoundException
IOException
public static boolean delete(File file, boolean recursivly)
file
- the file or directory to be deletedrecursivly
- If true, deletes the directory recursivly. If false or if file is not a directory, only the
specified file gets deleted.public static String[] getPathNames(File path)
path.equals(Files.getFile(Files.getRoot(path), Files.getPathNames(path))
path
- the pathpublic static File getFile(String... paths)
paths
- the path namespublic static File getFile(File parent, String... paths)
paths
- the path namespublic static File getRoot(File file)
path.equals(Files.getFile(Files.getRoot(path), Files.getPathNames(path))
file
- a file or directoryCopyright © 2002–2017 SoftSmithy. All rights reserved.