org.webframe.support.driver.resource.jar
Class JarResource

java.lang.Object
  extended by org.springframework.core.io.AbstractResource
      extended by org.springframework.core.io.AbstractFileResolvingResource
          extended by org.webframe.support.driver.resource.jar.JarResource
All Implemented Interfaces:
org.springframework.core.io.InputStreamSource, org.springframework.core.io.Resource

public class JarResource
extends org.springframework.core.io.AbstractFileResolvingResource

JarResource资源类,用于处理jar包中的资源文件

Version:
$Id: codetemplates.xml,v 1.1 2009/09/07 08:48:12 Exp $ Create: 2011-4-6 下午08:27:52
Author:
黄国庆

Field Summary
private  Set<String> entriesPath
           
private  Map<String,Set<String>> entryFilesPathMap
           
private  JarEntry jarEntry
           
private  JarFile jarFile
           
private  String jarName
           
private  JarURLConnection jarURLConnection
           
private  String path
           
 
Constructor Summary
  JarResource(JarURLConnection jarURLConnection)
           
private JarResource(JarURLConnection jarURLConnection, JarFile jarFile, String jarName, Set<String> entriesPath, String path)
           
 
Method Summary
 void close()
           
 org.springframework.core.io.Resource createRelative(String relativePath)
           
 boolean equals(Object obj)
           
 boolean exists()
           
 String getDescription()
           
 Set<String> getEntriesPath()
           
 Set<String> getEntryFilesByDir(String directory, org.springframework.util.PathMatcher matcher)
           
 String getFilename()
           
 InputStream getInputStream()
           
 JarEntry getJarEntry(String entryName)
           
 URL getURL()
           
 int hashCode()
           
private  String resolveJarEntryPath(String path)
           
 
Methods inherited from class org.springframework.core.io.AbstractFileResolvingResource
contentLength, getFile, getFile, getFileForLastModifiedCheck, isReadable, lastModified
 
Methods inherited from class org.springframework.core.io.AbstractResource
getURI, isOpen, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

jarName

private String jarName

jarURLConnection

private final JarURLConnection jarURLConnection

jarEntry

private JarEntry jarEntry

path

private final String path

entriesPath

private Set<String> entriesPath

entryFilesPathMap

private final Map<String,Set<String>> entryFilesPathMap

jarFile

private JarFile jarFile
Constructor Detail

JarResource

public JarResource(JarURLConnection jarURLConnection)
            throws IOException
Throws:
IOException

JarResource

private JarResource(JarURLConnection jarURLConnection,
                    JarFile jarFile,
                    String jarName,
                    Set<String> entriesPath,
                    String path)
Method Detail

createRelative

public org.springframework.core.io.Resource createRelative(String relativePath)
Specified by:
createRelative in interface org.springframework.core.io.Resource
Overrides:
createRelative in class org.springframework.core.io.AbstractResource

getDescription

public String getDescription()

getInputStream

public InputStream getInputStream()
                           throws IOException
Throws:
IOException

getURL

public URL getURL()
           throws IOException
Specified by:
getURL in interface org.springframework.core.io.Resource
Overrides:
getURL in class org.springframework.core.io.AbstractResource
Throws:
IOException

exists

public boolean exists()
Specified by:
exists in interface org.springframework.core.io.Resource
Overrides:
exists in class org.springframework.core.io.AbstractFileResolvingResource

getFilename

public String getFilename()
Specified by:
getFilename in interface org.springframework.core.io.Resource
Overrides:
getFilename in class org.springframework.core.io.AbstractResource

hashCode

public int hashCode()
Overrides:
hashCode in class org.springframework.core.io.AbstractResource

equals

public boolean equals(Object obj)
Overrides:
equals in class org.springframework.core.io.AbstractResource

getEntryFilesByDir

public Set<String> getEntryFilesByDir(String directory,
                                      org.springframework.util.PathMatcher matcher)

getJarEntry

public JarEntry getJarEntry(String entryName)

getEntriesPath

public Set<String> getEntriesPath()

resolveJarEntryPath

private String resolveJarEntryPath(String path)

close

public void close()
           throws IOException
Throws:
IOException


Copyright © 2012. All Rights Reserved.