本文整理了Java中com.github.junrar.Archive.<init>()
方法的一些代码示例,展示了Archive.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Archive.<init>()
方法的具体详情如下:
包路径:com.github.junrar.Archive
类名称:Archive
方法名:<init>
[英]create a new archive object using the given VolumeManager
[中]使用给定的VolumeManager创建新的存档对象
代码示例来源:origin: SeanDragon/protools
try (Archive archive = new Archive(rarFile)) {
FileHeader fh = archive.nextFileHeader();
while (fh != null) {
代码示例来源:origin: com.github.junrar/junrar
private static Archive createArchiveOrThrowException(final Log logger, final InputStream rarAsStream) throws RarException, IOException {
try {
return new Archive(rarAsStream);
} catch (final RarException e) {
logger.error(e);
throw e;
} catch (final IOException e1) {
logger.error(e1);
throw e1;
}
}
代码示例来源:origin: apache/tika
try (TemporaryResources tmp = new TemporaryResources()) {
TikaInputStream tis = TikaInputStream.get(stream, tmp);
rar = new Archive(new FileVolumeManager(tis.getFile()));
代码示例来源:origin: com.github.junrar/junrar
public static List<File> extract(
final ExtractDestination destination,
final VolumeManager volumeManager
) throws RarException, IOException {
final Archive archive = new Archive(volumeManager);
return extractArchiveTo(archive, destination);
}
代码示例来源:origin: mucommander/mucommander
public RarFile(AbstractFile file) throws IOException, UnsupportedFileOperationException, RarException {
InputStream fileIn = file.getInputStream();
try {
archive = new Archive(new File(file.getPath()));
}
finally {
fileIn.close();
}
}
代码示例来源:origin: com.github.junrar/junrar
private static Archive createArchiveOrThrowException(
final Log logger,
final File file
) throws RarException, IOException {
try {
return new Archive(new FileVolumeManager(file));
} catch (final RarException e) {
logger.error(e);
throw e;
} catch (final IOException e1) {
logger.error(e1);
throw e1;
}
}
代码示例来源:origin: uk.gov.nationalarchives/droid-core-interfaces
@Override
public void handle(IdentificationRequest request) throws IOException {
if (request.getClass().isAssignableFrom(FileSystemIdentificationRequest.class)) {
FileSystemIdentificationRequest req = (FileSystemIdentificationRequest) request;
FileVolumeManager fileVolumeManager = new FileVolumeManager(req.getFile());
try {
try (Archive archive = new Archive(fileVolumeManager)) {
if (archive.isEncrypted()) {
throw new RuntimeException("Encrypted archive");
}
RarWalker walker = new RarWalker(archive, req.getIdentifier());
walker.walk(archive.getFileHeaders());
}
} catch (RarException ex) {
throw new RuntimeException("Rar procesing failed :", ex);
}
} else {
log.info("Identification request for RAR archive ignored due to limited support.");
}
}
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.api.datasets-asl
coerceToList(cfg.get("excludes")));
try (Archive archive = new Archive(new FileVolumeManager(aCachedFile.toFile()))) {
FileHeader fh = archive.nextFileHeader();
while (fh != null) {
代码示例来源:origin: dkpro/dkpro-core
coerceToList(cfg.get("excludes")));
try (Archive archive = new Archive(new FileVolumeManager(aCachedFile.toFile()))) {
FileHeader fh = archive.nextFileHeader();
while (fh != null) {
代码示例来源:origin: edmund-wagner/junrar
Archive a = null;
try {
a = new Archive(new FileVolumeManager(f));
} catch (RarException e) {
代码示例来源:origin: digital-preservation/droid
@Override
public void handle(IdentificationRequest request) throws IOException {
VolumeManager readerVolume = new RarReader(request.getWindowReader());
try {
try (Archive archive = new Archive(readerVolume)) {
if (archive.isEncrypted()) {
throw new RuntimeException("Encrypted archive");
}
RarWalker walker = new RarWalker(archive, request.getIdentifier());
walker.walk(archive.getFileHeaders());
}
} catch (RarException ex) {
throw new RuntimeException("Rar processing failed :", ex);
}
}
代码示例来源:origin: digital-preservation/droid
/**
* @param uri to identify
* @param request identification request. Only FileSystemIdentificationRequest is supported.
* @throws CommandExecutionException ex.
*/
public void identify(final URI uri, final IdentificationRequest request) throws CommandExecutionException {
final String newPath = makeContainerURI("rar", request.getFileName());
setSlash1("");
if (request.getClass().isAssignableFrom(FileSystemIdentificationRequest.class)) {
FileSystemIdentificationRequest req = (FileSystemIdentificationRequest) request;
FileVolumeManager fileVolumeManager = new FileVolumeManager(req.getFile().toFile());
try {
try (Archive archive = new Archive(fileVolumeManager)) {
if (archive.isEncrypted()) {
log.info("encrypted rar");
} else {
for (FileHeader entry : archive.getFileHeaders()) {
processEntry(entry, archive, uri, newPath);
}
}
}
} catch (IOException e) {
throw new CommandExecutionException("IO error in RARFileSystem", e);
} catch (RarException ex) {
throw new CommandExecutionException("Rar exception in RARFileSystem", ex);
}
} else {
log.info("Identification request for RAR archive ignored due to limited support.");
}
}
代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-parsers
try (TemporaryResources tmp = new TemporaryResources()) {
TikaInputStream tis = TikaInputStream.get(stream, tmp);
rar = new Archive(tis.getFile());
代码示例来源:origin: edmund-wagner/junrar
archive = new Archive(new VFSVolumeManager(parentLayer));
代码示例来源:origin: org.apache.tika/tika-parsers
try (TemporaryResources tmp = new TemporaryResources()) {
TikaInputStream tis = TikaInputStream.get(stream, tmp);
rar = new Archive(new FileVolumeManager(tis.getFile()));
代码示例来源:origin: com.github.junrar/junrar
this.archive = new Archive(new VFSVolumeManager(this.parentLayer));
内容来源于网络,如有侵权,请联系作者删除!