Filenamepublic class Filename extends Object
Fields Summary |
---|
private String | fullPath | private char | pathSeparator | private char | extensionSeparator |
Constructors Summary |
---|
public Filename(String str, char sep, char ext)
fullPath = str;
pathSeparator = sep;
extensionSeparator = ext;
|
Methods Summary |
---|
public java.lang.String | extension()
int dot = fullPath.lastIndexOf(extensionSeparator);
return fullPath.substring(dot + 1);
| public java.lang.String | filename()
int dot = fullPath.lastIndexOf(extensionSeparator);
int sep = fullPath.lastIndexOf(pathSeparator);
return fullPath.substring(sep + 1, dot);
| public java.lang.String | path()
int sep = fullPath.lastIndexOf(pathSeparator);
return fullPath.substring(0, sep);
|
|