Top Fields Constructors Methods
org.python.core

public Class SyspathArchive

extends PyString
Class Inheritance
Annotations
@Untraversable
Imports
java.io.ByteArrayInputStream, .File, .IOException, .InputStream, java.util.zip.ZipEntry, .ZipFile

Field Summary

Modifier and TypeField and Description
private ZipFile
Inherited from org.python.core.PyString:
internedstringTYPE

Constructor Summary

AccessConstructor and Description
public
SyspathArchive(String archiveName)

pack-priv
SyspathArchive(ZipFile zipFile, String path)

Method Summary

Modifier and TypeMethod and Description
public String
pack-priv static SyspathArchive

Returns:

SyspathArchive for the path
fromPath
(String
to represent
path
)

Return a SyspathArchive wrapping the FS-encoded path into a ".zip" or ".jar" file (like "x/y/a.jar/b/c.x") and ZipFile archive representing the file part ("x/y/a.jar") of that path.

pack-priv static String

Returns:

archive name or null if the argument is does not contain ".zip" or ".jar"
getArchiveName
(String
to extract from
dir
)

Return the archive name extracted from a path like "x/y/a.jar/b/c.x" as a String, extracted from the path by truncation.

pack-priv ZipEntry
getEntry(String entryName)

pack-priv InputStream
private String
public SyspathArchive
Inherited from org.python.core.PyString:
__add____cmp____complex____contains____eq____float____format____ge____getnewargs____gt____int____invert____le____len____long____lt____mod____mul____ne____neg____pos____repr____rmul____str____tojava____unicode___count_find_findLeft_findRight_lstrip_lstrip_replace_rfind_rsplit_rstrip_rstrip_split_strip_stripasDoubleasIntasLongasNameasStringasStringasU16BytesOrErroratofatoiatoiatolatolbuildFormattedStringcapitalizecentercharAtcharsFitWidthcheckIndexcountcountcountcountcountcountcreateInstancecreateInstancedecodedecodedecodedecode_UnicodeEscapeencodeencodeencodeencode_UnicodeEscapeencode_UnicodeEscapeendswithendswithendswithexpandtabsexpandtabsfindfindfindfindfindfindfromInternedfromSubstringgetBuffergetIntgetslicegetStringhashCodeindexindexindexindexindexindexinternedStringisalnumisalphaisBasicPlaneisdecimalisdigitislowerisnumericisspaceistitleisunicodeisupperjoinlengthljustljustlowerlstriplstriplstrippartitionprepareFormatterpygetrepeatreplacereplacerfindrfindrfindrfindrfindrfindrindexrindexrindexrindexrindexrindexrjustrpartitionrsplitrsplitrsplitrsplitrsplitrsplitfieldsrstriprstriprstripsplitsplitsplitsplitsplitsplitfieldssplitlinessplitlinesstartswithstartswithstartswithstr___add__str___cmp__str___contains__str___eq__str___format__str___ge__str___getitem__str___getnewargs__str___getslice__str___gt__str___hash__str___le__str___len__str___lt__str___mod__str___mul__str___ne__str___repr__str___rmul__str___str__str__formatter_field_name_splitstr__formatter_parserstr_capitalizestr_centerstr_countstr_decodestr_encodestr_endswithstr_expandtabsstr_findstr_formatstr_indexstr_isalnumstr_isalphastr_isdecimalstr_isdigitstr_islowerstr_isnumericstr_isspacestr_istitlestr_isunicodestr_isupperstr_joinstr_ljuststr_lowerstr_lstripstr_newstr_partitionstr_replacestr_rfindstr_rindexstr_rjuststr_rpartitionstr_rsplitstr_rstripstr_splitstr_splitlinesstr_startswithstr_stripstr_swapcasestr_titlestr_translatestr_upperstr_zfillstripstripstripsubSequencesubstringswapcasetitletoBytestoCodePointstoStringtranslatetranslatetranslatetranslatetranslateIndicesunicodeJoinunicodePartitionunicodeRpartitionunsupportedopMessageupperzfill

Field Detail

zipFileback to summary
private ZipFile zipFile

Constructor Detail

SyspathArchiveback to summary
public SyspathArchive(String archiveName) throws IOException
SyspathArchiveback to summary
pack-priv SyspathArchive(ZipFile zipFile, String path)

Method Detail

asUriCompatibleStringback to summary
public String asUriCompatibleString()
fromPathback to summary
pack-priv static SyspathArchive fromPath(String path) throws IOException

Return a SyspathArchive wrapping the FS-encoded path into a ".zip" or ".jar" file (like "x/y/a.jar/b/c.x") and ZipFile archive representing the file part ("x/y/a.jar") of that path. This is guaranteed to be bytes-like (all chars < 256). The method throws if the argument is malformed, meaning it does not contain ".zip" or ".jar", (terminally or followed by "/").

Parameters
path:String

to represent

Returns:SyspathArchive

SyspathArchive for the path

Exceptions
IOException:
if the argument is malformed

getArchiveNameback to summary
pack-priv static String getArchiveName(String dir)

Return the archive name extracted from a path like "x/y/a.jar/b/c.x" as a String, extracted from the path by truncation. Here the archive name would be the "x/y/a.jar" part. The method returns null if the argument is malformed, meaning it does not contain ".zip" or ".jar", (terminally or followed by "/").

Parameters
dir:String

to extract from

Returns:String

archive name or null if the argument is does not contain ".zip" or ".jar"

getEntryback to summary
pack-priv ZipEntry getEntry(String entryName)
getInputStreamback to summary
pack-priv InputStream getInputStream(ZipEntry entry) throws IOException
makeEntryback to summary
private String makeEntry(String entry)
makeSubfolderback to summary
public SyspathArchive makeSubfolder(String folder)