org.webframe.support.driver.resource.jar
Class JarResource
java.lang.Object
org.springframework.core.io.AbstractResource
org.springframework.core.io.AbstractFileResolvingResource
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:
- 黄国庆
| 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 |
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
JarResource
public JarResource(JarURLConnection jarURLConnection)
throws IOException
- Throws:
IOException
JarResource
private JarResource(JarURLConnection jarURLConnection,
JarFile jarFile,
String jarName,
Set<String> entriesPath,
String path)
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.