org.eclipse.jetty.util.resource
类 URLResource

java.lang.Object
  继承者 org.eclipse.jetty.util.resource.Resource
      继承者 org.eclipse.jetty.util.resource.URLResource
所有已实现的接口:
ResourceFactory
直接已知子类:
FileResource, JarResource

public class URLResource
extends Resource

Abstract resource class.


字段摘要
protected  URLConnection _connection
           
protected  InputStream _in
           
protected  URL _url
           
protected  String _urlString
           
 
从类 org.eclipse.jetty.util.resource.Resource 继承的字段
__defaultUseCaches
 
构造方法摘要
protected URLResource(URL url, URLConnection connection)
           
protected URLResource(URL url, URLConnection connection, boolean useCaches)
           
 
方法摘要
 Resource addPath(String path)
          Returns the resource contained inside the current resource with the given name
protected  boolean checkConnection()
           
 boolean delete()
          Deletes the given resource
 boolean equals(Object o)
           
 boolean exists()
          Returns true if the represented resource exists.
 File getFile()
          Returns an File representing the given resource or NULL if this is not possible.
 InputStream getInputStream()
          Returns an input stream to the resource
 String getName()
          Returns the name of the resource
 OutputStream getOutputStream()
          Returns an output stream to the resource
 URL getURL()
          Returns an URL representing the given resource
 boolean getUseCaches()
           
 int hashCode()
           
 boolean isContainedIn(Resource containingResource)
           
 boolean isDirectory()
          Returns true if the respresenetd resource is a container/directory.
 long lastModified()
          Returns the last modified time
 long length()
          Return the length of the resource
 String[] list()
          Returns a list of resource names contained in the given resource
 void release()
          Release any resources held by the resource.
 boolean renameTo(Resource dest)
          Rename the given resource
 String toString()
           
 
从类 org.eclipse.jetty.util.resource.Resource 继承的方法
copyTo, encode, finalize, getAlias, getAssociate, getDefaultUseCaches, getListHTML, getResource, getURI, getWeakETag, isContainedIn, newClassPathResource, newClassPathResource, newResource, newResource, newResource, newResource, newResource, newSystemResource, setAssociate, setDefaultUseCaches, toURL, writeTo
 
从类 java.lang.Object 继承的方法
clone, getClass, notify, notifyAll, wait, wait, wait
 

字段详细信息

_url

protected URL _url

_urlString

protected String _urlString

_connection

protected URLConnection _connection

_in

protected InputStream _in
构造方法详细信息

URLResource

protected URLResource(URL url,
                      URLConnection connection)

URLResource

protected URLResource(URL url,
                      URLConnection connection,
                      boolean useCaches)
方法详细信息

checkConnection

protected boolean checkConnection()

release

public void release()
Release any resources held by the resource.

指定者:
Resource 中的 release

exists

public boolean exists()
Returns true if the represented resource exists.

指定者:
Resource 中的 exists

isDirectory

public boolean isDirectory()
Returns true if the respresenetd resource is a container/directory. If the resource is not a file, resources ending with "/" are considered directories.

指定者:
Resource 中的 isDirectory

lastModified

public long lastModified()
Returns the last modified time

指定者:
Resource 中的 lastModified

length

public long length()
Return the length of the resource

指定者:
Resource 中的 length

getURL

public URL getURL()
Returns an URL representing the given resource

指定者:
Resource 中的 getURL

getFile

public File getFile()
             throws IOException
Returns an File representing the given resource or NULL if this is not possible.

指定者:
Resource 中的 getFile
抛出:
IOException

getName

public String getName()
Returns the name of the resource

指定者:
Resource 中的 getName

getInputStream

public InputStream getInputStream()
                           throws IOException
Returns an input stream to the resource

指定者:
Resource 中的 getInputStream
抛出:
IOException

getOutputStream

public OutputStream getOutputStream()
                             throws IOException,
                                    SecurityException
Returns an output stream to the resource

指定者:
Resource 中的 getOutputStream
抛出:
IOException
SecurityException

delete

public boolean delete()
               throws SecurityException
Deletes the given resource

指定者:
Resource 中的 delete
抛出:
SecurityException

renameTo

public boolean renameTo(Resource dest)
                 throws SecurityException
Rename the given resource

指定者:
Resource 中的 renameTo
抛出:
SecurityException

list

public String[] list()
Returns a list of resource names contained in the given resource

指定者:
Resource 中的 list

addPath

public Resource addPath(String path)
                 throws IOException,
                        MalformedURLException
Returns the resource contained inside the current resource with the given name

指定者:
Resource 中的 addPath
参数:
path - The path segment to add, which should be encoded by the encode method.
抛出:
IOException
MalformedURLException

toString

public String toString()
覆盖:
Object 中的 toString

hashCode

public int hashCode()
覆盖:
Object 中的 hashCode

equals

public boolean equals(Object o)
覆盖:
Object 中的 equals

getUseCaches

public boolean getUseCaches()

isContainedIn

public boolean isContainedIn(Resource containingResource)
                      throws MalformedURLException
指定者:
Resource 中的 isContainedIn
抛出:
MalformedURLException


Copyright © 2013. All Rights Reserved.