public class UrlResource extends AbstractResource
Title: UrlResource.java
Description:
bboss workgroup
Copyright (c) 2007
savesize| 构造器和说明 |
|---|
UrlResource(java.lang.String path)
Create a new UrlResource.
|
UrlResource(java.net.URI uri)
Create a new UrlResource.
|
UrlResource(java.net.URL url)
Create a new UrlResource.
|
| 限定符和类型 | 方法和说明 |
|---|---|
long |
contentLength()
This implementation checks the timestamp of the underlying File,
if available.
|
org.frameworkset.util.io.Resource |
createRelative(java.lang.String relativePath)
This implementation creates a UrlResource, applying the given path
relative to the path of the underlying URL of this resource descriptor.
|
boolean |
equals(java.lang.Object obj)
This implementation compares the underlying URL references.
|
java.lang.String |
getDescription()
This implementation returns a description that includes the URL.
|
java.io.File |
getFile()
This implementation returns a File reference for the underlying URL/URI,
provided that it refers to a file in the file system.
|
protected java.io.File |
getFileForLastModifiedCheck()
This implementation determines the underlying File
(or jar file, in case of a resource in a jar/zip).
|
java.lang.String |
getFilename()
This implementation returns the name of the file that this URL refers to.
|
long |
getHeaderFieldLong(java.lang.String name,
long Default) |
java.io.InputStream |
getInputStream()
This implementation opens an InputStream for the given URL.
|
long |
getTotalsize() |
java.net.URI |
getURI()
This implementation returns the underlying URI directly,
if possible.
|
java.net.URL |
getURL()
This implementation returns the underlying URL reference.
|
int |
hashCode()
This implementation returns the hash code of the underlying URL reference.
|
void |
open() |
void |
open(boolean reopen) |
void |
release() |
exists, getSavesize, isOpen, isReadable, lastModified, savetofile, savetofile, toStringpublic UrlResource(java.net.URL url)
url - a URLpublic UrlResource(java.net.URI uri)
throws java.net.MalformedURLException
uri - a URIjava.net.MalformedURLException - if the given URL path is not validpublic UrlResource(java.lang.String path)
throws java.net.MalformedURLException
path - a URL pathjava.net.MalformedURLException - if the given URL path is not validpublic void open()
throws java.io.IOException
java.io.IOExceptionpublic void open(boolean reopen)
throws java.io.IOException
java.io.IOExceptionpublic long getHeaderFieldLong(java.lang.String name,
long Default)
public java.io.InputStream getInputStream()
throws java.io.IOException
false,
mainly to avoid jar file locking on Windows.java.io.IOExceptionURL.openConnection(),
URLConnection.setUseCaches(boolean),
URLConnection.getInputStream()public java.net.URL getURL()
throws java.io.IOException
getURL 在接口中 org.frameworkset.util.io.ResourcegetURL 在类中 AbstractResourcejava.io.IOExceptionpublic java.net.URI getURI()
throws java.io.IOException
getURI 在接口中 org.frameworkset.util.io.ResourcegetURI 在类中 AbstractResourcejava.io.IOExceptionpublic java.io.File getFile()
throws java.io.IOException
getFile 在接口中 org.frameworkset.util.io.ResourcegetFile 在类中 AbstractResourcejava.io.IOExceptionResourceUtils.getFile(java.net.URL, String)protected java.io.File getFileForLastModifiedCheck()
throws java.io.IOException
getFileForLastModifiedCheck 在类中 AbstractResourcenull)java.io.IOException - if the resource cannot be resolved as absolute
file path, i.e. if the resource is not available in a file systempublic org.frameworkset.util.io.Resource createRelative(java.lang.String relativePath)
throws java.net.MalformedURLException
createRelative 在接口中 org.frameworkset.util.io.ResourcecreateRelative 在类中 AbstractResourcejava.net.MalformedURLExceptionURL.URL(java.net.URL, String)public java.lang.String getFilename()
getFilename 在接口中 org.frameworkset.util.io.ResourcegetFilename 在类中 AbstractResourceURL.getFile(),
File.getName()public java.lang.String getDescription()
public boolean equals(java.lang.Object obj)
equals 在类中 AbstractResourceResource.getDescription()public int hashCode()
hashCode 在类中 AbstractResourceResource.getDescription()public void release()
release 在接口中 org.frameworkset.util.io.Resourcerelease 在类中 AbstractResourcepublic long contentLength()
throws java.io.IOException
contentLength 在接口中 org.frameworkset.util.io.ResourcecontentLength 在类中 AbstractResourcejava.io.IOExceptiongetFile()public long getTotalsize()