Package de.srsoftware.tools.files
Class FileName
- java.lang.Object
-
- de.srsoftware.tools.files.FileName
-
public class FileName extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringdeleteNonFilenameChars(String string)StringgetFileNameFromPath()returns the filename without any path informationStringgetPathNameFromPath()returns the path without trailing filenameStringgetPathRelativeToFile(String baseFile)returns the filename relative to the File baseFilestatic StringsearchFile(String filename)sucht nach der Datei <filename> in allen Unterverzeichnissen des angegebenen Pfadesstatic StringsearchFileUpward(String filename, int levels)Takes the path from the fully specified filename, goes <levels> directory levels up and searches the file beginning from there.
Result:
The filname including a path, if successfull, null otherwisevoidsetFileName(String newFileName)sets the current FileName's filename parameterStringtoString()returns the absolute filename
-
-
-
Constructor Detail
-
FileName
public FileName()
Constructs a new, empty FileName object
-
FileName
public FileName(String filename)
Constructs a new FileName object using the given filename
-
-
Method Detail
-
searchFile
public static String searchFile(String filename)
sucht nach der Datei <filename> in allen Unterverzeichnissen des angegebenen Pfades
-
searchFileUpward
public static String searchFileUpward(String filename, int levels)
Takes the path from the fully specified filename, goes <levels> directory levels up and searches the file beginning from there.
Result:
The filname including a path, if successfull, null otherwise
-
getFileNameFromPath
public String getFileNameFromPath()
returns the filename without any path information
-
getPathNameFromPath
public String getPathNameFromPath()
returns the path without trailing filename
-
getPathRelativeToFile
public String getPathRelativeToFile(String baseFile)
returns the filename relative to the File baseFile
-
setFileName
public void setFileName(String newFileName)
sets the current FileName's filename parameter
-
-