本文整理了Java中de.schlichtherle.truezip.zip.ZipEntry.getName()
方法的一些代码示例,展示了ZipEntry.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipEntry.getName()
方法的具体详情如下:
包路径:de.schlichtherle.truezip.zip.ZipEntry
类名称:ZipEntry
方法名:getName
[英]Returns the ZIP entry name.
[中]返回ZIP条目名。
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
byte[] getReadPassword(boolean invalid) throws ZipKeyException {
return param.getReadPassword(entry.getName(), invalid);
}
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
AesKeyStrength getKeyStrength() throws ZipKeyException {
return param.getKeyStrength(entry.getName());
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
void setKeyStrength(AesKeyStrength keyStrength) throws ZipKeyException {
param.setKeyStrength(entry.getName(), keyStrength);
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
byte[] getWritePassword() throws ZipKeyException {
return param.getWritePassword(entry.getName());
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
/**
* Equivalent to {@link #getInputStream(String, Boolean, boolean)
* getInputStream(entry.getName(), null, true)} instead.
*/
@CreatesObligation
public final @Nullable InputStream getInputStream(ZipEntry entry)
throws IOException {
return getInputStream(entry.getName(), null, true);
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
/**
* Equivalent to {@link #getInputStream(String, Boolean, boolean)
* getInputStream(entry.getName(), true, true)} instead.
*/
@CreatesObligation
public final @Nullable InputStream getCheckedInputStream(ZipEntry entry)
throws IOException {
return getInputStream(entry.getName(), true, true);
}
代码示例来源:origin: org.jboss.windup.org.apache.maven.indexer/indexer-core
public List<String> getEntries( EntryNameFilter filter )
{
ArrayList<String> entries = new ArrayList<String>();
Enumeration<? extends ZipEntry> en = getZipFile().entries();
while ( en.hasMoreElements() )
{
final ZipEntry e = en.nextElement();
final String name = e.getName();
if ( filter != null && !filter.accepts( name ) )
{
continue;
}
entries.add( name );
}
return entries;
}
代码示例来源:origin: org.apache.maven.indexer/indexer-core
public List<String> getEntries( EntryNameFilter filter )
{
ArrayList<String> entries = new ArrayList<String>();
Enumeration<? extends ZipEntry> en = getZipFile().entries();
while ( en.hasMoreElements() )
{
final ZipEntry e = en.nextElement();
final String name = e.getName();
if ( filter != null && !filter.accepts( name ) )
{
continue;
}
entries.add( name );
}
return entries;
}
代码示例来源:origin: apache/maven-indexer
public List<String> getEntries( EntryNameFilter filter )
{
ArrayList<String> entries = new ArrayList<String>();
Enumeration<? extends ZipEntry> en = getZipFile().entries();
while ( en.hasMoreElements() )
{
final ZipEntry e = en.nextElement();
final String name = e.getName();
if ( filter != null && !filter.accepts( name ) )
{
continue;
}
entries.add( name );
}
return entries;
}
代码示例来源:origin: digital-preservation/droid
@Override
protected void handleEntry(ZipEntry entry) throws IOException {
String entryName = entry.getName();
final String prefixPath = FilenameUtils.getPath(entryName);
ResourceId correlationId = parentId; // by default, files are correlated to the parent.
// If there is a path, get the actual correlation id for its parent folder:
if (!prefixPath.isEmpty()) {
correlationId = directories.get(prefixPath);
// If we haven't seen the path before, add the ancestor folders not yet seen:
if (correlationId == null) {
correlationId = processAncestorFolders(prefixPath);
}
}
// If there is a file, submit the file:
entryName = FilenameUtils.getName(entryName);
if (!entryName.isEmpty()) {
submit(entry, entryName, parentName, zipFile, correlationId, originatorNodeId);
}
}
}
代码示例来源:origin: uk.gov.nationalarchives/droid-core-interfaces
@Override
protected void handleEntry(ZipEntry entry) throws IOException {
String entryName = entry.getName();
final String prefixPath = FilenameUtils.getPath(entryName);
ResourceId correlationId = parentId; // by default, files are correlated to the parent.
// If there is a path, get the actual correlation id for its parent folder:
if (!prefixPath.isEmpty()) {
correlationId = directories.get(prefixPath);
// If we haven't seen the path before, add the ancestor folders not yet seen:
if (correlationId == null) {
correlationId = processAncestorFolders(prefixPath);
}
}
// If there is a file, submit the file:
entryName = FilenameUtils.getName(entryName);
if (!entryName.isEmpty()) {
submit(entry, entryName, parentName, zipFile, correlationId, originatorNodeId);
}
}
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
final StringBuilder s = new StringBuilder(256);
final Formatter f = new Formatter(s)
.format("%s[name=%s", getClass().getName(), getName());
long value;
if (UNKNOWN != (value = getGeneralPurposeBitFlags()))
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
@Override
public void close() throws IOException {
if (!closed) {
while (skip(Long.MAX_VALUE) > 0) {
// process CRC-32 until EOF
}
}
super.close();
closed = true;
final long expected = entry.getCrc();
final long computed = getChecksum().getValue();
if (expected != computed)
throw new CRC32Exception(entry.getName(), expected, computed);
}
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
this.entries.put(entry.getName(), entry);
this.entry = entry;
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
/**
* Authenticates all encrypted data in this read only file.
* It is safe to call this method multiple times to detect if the file
* has been tampered with meanwhile.
*
* @throws ZipAuthenticationException If the computed MAC does not match
* the MAC declared in the WinZip AES entry.
* @throws IOException On any I/O related issue.
*/
void authenticate() throws IOException {
final Mac mac = new HMac(new SHA1Digest());
mac.init(sha1MacParam);
final byte[] buf = computeMac(mac);
if (!ArrayHelper.equals(buf, 0, authenticationCode, 0, authenticationCode.length))
throw new ZipAuthenticationException(entry.getName()
+ " (authenticated WinZip AES entry content has been tampered with)");
}
}
代码示例来源:origin: uk.gov.nationalarchives/droid-core-interfaces
/**
* @param parentName
* @param entry
* @param entryName
* @param correlationId
* @return
*/
private ResourceId submitDirectory(final URI parentName,
ZipEntry entry, String entryName, ResourceId correlationId) {
IdentificationResultImpl result = new IdentificationResultImpl();
long size = entry.getSize();
long time = entry.getTime();
RequestMetaData metaData = new RequestMetaData(
size != -1 ? size : null,
time != -1 ? time : null,
entryName);
RequestIdentifier identifier = new RequestIdentifier(
ArchiveFileUtils.toZipUri(parentName, entry.getName()));
result.setRequestMetaData(metaData);
result.setIdentifier(identifier);
return resultHandler.handleDirectory(result, correlationId, false);
}
代码示例来源:origin: uk.gov.nationalarchives/droid-core-interfaces
entryName);
RequestIdentifier identifier = new RequestIdentifier(ArchiveFileUtils.toZipUri(parentName, entry.getName()));
identifier.setAncestorId(originatorNodeId);
identifier.setParentResourceId(correlationId);
代码示例来源:origin: digital-preservation/droid
/**
* @param parentName
* @param entry
* @param entryName
* @param correlationId
* @return
*/
private ResourceId submitDirectory(final URI parentName,
ZipEntry entry, String entryName, ResourceId correlationId) {
IdentificationResultImpl result = new IdentificationResultImpl();
long size = entry.getSize();
long time = entry.getTime();
RequestMetaData metaData = new RequestMetaData(
size != -1 ? size : null,
time != -1 ? time : null,
entryName);
RequestIdentifier identifier = new RequestIdentifier(
ArchiveFileUtils.toZipUri(parentName, entry.getName()));
result.setRequestMetaData(metaData);
result.setIdentifier(identifier);
return resultHandler.handleDirectory(result, correlationId, false);
}
代码示例来源:origin: digital-preservation/droid
entryName);
RequestIdentifier identifier = new RequestIdentifier(ArchiveFileUtils.toZipUri(parentName, entry.getName()));
identifier.setAncestorId(originatorNodeId);
identifier.setParentResourceId(correlationId);
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
assertTrue(set.remove(entry.getName()));
内容来源于网络,如有侵权,请联系作者删除!