/home/gshute/netbeans/Toolkit/src/vfs/VFSFile.java |
package vfs;
import java.net.MalformedURLException;
import java.net.URL;
<p>
</p>
@author
public class VFSFile
implements VFSItem {
private String name;
private URL url;
public VFSFile(String nm, VFSDirectory par) {
super();
name = nm;
if (par != null) {
try {
url = new URL(par.getURL(), nm);
} catch (MalformedURLException ex) {
throw new Error("Bad name: " + nm, ex);
}
}
}
public String getName() {
return name;
}
public URL getURL() {
return url;
}
public String getSuffix() {
int dotPosition = name.lastIndexOf(".");
if (dotPosition < 0) {
return null;
}
return name.substring(dotPosition + 1);
}
}