Package com.softsynth.jmsl.util
Class FilenameTool
java.lang.Object
com.softsynth.jmsl.util.FilenameTool
public class FilenameTool
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
fileSeparator
-
Constructor Summary
Constructors Constructor Description FilenameTool()
-
Method Summary
Modifier and Type Method Description static java.lang.String
appendIfNeeded(java.lang.String fname, java.lang.String ext)
Appends extension if not already there.static java.lang.String
getFileNoPath(java.lang.String s)
Pull the filename out of a full path, Ex.static java.lang.String
getPathWithoutFilename(java.lang.String s)
Pull the path off the front of a path + filenamestatic boolean
hasExtension(java.lang.String fname, java.lang.String ext)
True if filename ends in extension dot + ext.static java.lang.String
intToString(int value, int places)
create a string with leading zeroes up to places placesstatic java.lang.String
intToString(int value, int places, java.lang.String pad)
create a string with leading char up to places placesstatic void
main(java.lang.String[] args)
static java.lang.String
sansExtension(java.lang.String fname)
returns path and filename without extensionMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
fileSeparator
public static java.lang.String fileSeparator
-
-
Constructor Details
-
FilenameTool
public FilenameTool()
-
-
Method Details
-
hasExtension
public static boolean hasExtension(java.lang.String fname, java.lang.String ext)True if filename ends in extension dot + ext. Case insensitive -
appendIfNeeded
public static java.lang.String appendIfNeeded(java.lang.String fname, java.lang.String ext)Appends extension if not already there. Case insensitive -
sansExtension
public static java.lang.String sansExtension(java.lang.String fname)returns path and filename without extension -
getFileNoPath
public static java.lang.String getFileNoPath(java.lang.String s)Pull the filename out of a full path, Ex. C:\Nick\dude.txt returns dude.txt -
getPathWithoutFilename
public static java.lang.String getPathWithoutFilename(java.lang.String s)Pull the path off the front of a path + filename -
intToString
public static java.lang.String intToString(int value, int places, java.lang.String pad)create a string with leading char up to places places -
intToString
public static java.lang.String intToString(int value, int places)create a string with leading zeroes up to places places -
main
public static void main(java.lang.String[] args)
-