| Method from org.jboss.net.protocol.file.FileURLConnection Detail: |
public void connect() throws IOException {
if (connected)
return;
if (!file.exists())
{
throw new FileNotFoundException(file.getPath());
}
connected = true;
}
Checks if the underlying file for this connection exists. |
public File getFile() {
return file;
}
Returns the underlying file for this connection. |
public String getHeaderField(String name) {
String headerField = null;
if (name.equalsIgnoreCase("last-modified"))
headerField = String.valueOf(getLastModified());
else if (name.equalsIgnoreCase("content-length"))
headerField = String.valueOf(file.length());
else if (name.equalsIgnoreCase("content-type"))
headerField = getFileNameMap().getContentTypeFor(file.getName());
else if (name.equalsIgnoreCase("date"))
headerField = String.valueOf(file.lastModified());
else
{
// This always returns null currently
headerField = super.getHeaderField(name);
}
return headerField;
}
Provides support for returning the value for the
last-modified header. |
public InputStream getInputStream() throws IOException {
if (!connected)
connect();
return new FileInputStream(file);
}
|
public long getLastModified() {
return file.lastModified();
}
Returns the last modified time of the underlying file. |
public OutputStream getOutputStream() throws IOException {
if (!connected)
connect();
return new FileOutputStream(file);
}
|
public Permission getPermission() throws IOException {
return new FilePermission(file.getPath(), "read,write");
}
Return a permission for both read & write since both
input and output streams are supported. |