Class FileName


  • public class FileName
    extends Object
    • 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
      • toString

        public String toString()
        returns the absolute filename
        Overrides:
        toString in class Object
      • deleteNonFilenameChars

        public static String deleteNonFilenameChars​(String string)