本文整理汇总了Java中org.apache.commons.compress.tar.TarEntry类的典型用法代码示例。如果您正苦于以下问题:Java TarEntry类的具体用法?Java TarEntry怎么用?Java TarEntry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TarEntry类属于org.apache.commons.compress.tar包,在下文中一共展示了TarEntry类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTarEntry
import org.apache.commons.compress.tar.TarEntry; //导入依赖的package包/类
/**
* Sets the details for this file object.
*/
protected void setTarEntry(final TarEntry entry)
{
if (this.entry != null)
{
return;
}
if ((entry == null) || (entry.isDirectory()))
{
type = FileType.FOLDER;
}
else
{
type = FileType.FILE;
}
this.entry = entry;
}
示例2: getInputStream
import org.apache.commons.compress.tar.TarEntry; //导入依赖的package包/类
public InputStream getInputStream(TarEntry entry) throws FileSystemException
{
resetTarFile();
try
{
while (!tarFile.getNextEntry().equals(entry))
{
}
return tarFile;
}
catch (IOException e)
{
throw new FileSystemException(e);
}
}
示例3: TarFileObject
import org.apache.commons.compress.tar.TarEntry; //导入依赖的package包/类
protected TarFileObject(AbstractFileName name,
TarEntry entry,
TarFileSystem fs,
boolean tarExists) throws FileSystemException
{
super(name, fs);
this.fs = fs;
setTarEntry(entry);
if (!tarExists)
{
type = FileType.IMAGINARY;
}
}
示例4: getInputStream
import org.apache.commons.compress.tar.TarEntry; //导入依赖的package包/类
public InputStream getInputStream( TarEntry entry ) throws FileSystemException {
resetTarFile();
try {
while ( !tarFile.getNextEntry().equals( entry ) ) {
}
return tarFile;
} catch ( IOException e ) {
throw new FileSystemException( e );
}
}
示例5: TarFileObject
import org.apache.commons.compress.tar.TarEntry; //导入依赖的package包/类
protected TarFileObject(FileName name,
TarEntry entry,
TarFileSystem fs,
boolean tarExists) throws FileSystemException
{
super(name, fs);
this.fs = fs;
setTarEntry(entry);
if (!tarExists)
{
type = FileType.IMAGINARY;
}
}
示例6: init
import org.apache.commons.compress.tar.TarEntry; //导入依赖的package包/类
@Override
public void init() throws FileSystemException
{
super.init();
// Build the index
try
{
List<TarFileObject> strongRef = new ArrayList<TarFileObject>(100);
TarEntry entry;
while ((entry = getTarFile().getNextEntry()) != null)
{
AbstractFileName name = (AbstractFileName) getFileSystemManager().resolveName(getRootName(),
UriParser.encode(entry.getName()));
// Create the file
TarFileObject fileObj;
if (entry.isDirectory() && getFileFromCache(name) != null)
{
fileObj = (TarFileObject) getFileFromCache(name);
fileObj.setTarEntry(entry);
continue;
}
fileObj = createTarFileObject(name, entry);
putFileToCache(fileObj);
strongRef.add(fileObj);
fileObj.holdObject(strongRef);
// Make sure all ancestors exist
// TODO - create these on demand
TarFileObject parent = null;
for (AbstractFileName parentName = (AbstractFileName) name.getParent();
parentName != null;
fileObj = parent, parentName = (AbstractFileName) parentName.getParent())
{
// Locate the parent
parent = (TarFileObject) getFileFromCache(parentName);
if (parent == null)
{
parent = createTarFileObject(parentName, null);
putFileToCache(parent);
strongRef.add(parent);
parent.holdObject(strongRef);
}
// Attach child to parent
parent.attachChild(fileObj.getName());
}
}
}
catch (IOException e)
{
throw new FileSystemException(e);
}
finally
{
closeCommunicationLink();
}
}
示例7: createTarFileObject
import org.apache.commons.compress.tar.TarEntry; //导入依赖的package包/类
protected TarFileObject createTarFileObject(final AbstractFileName name,
final TarEntry entry) throws FileSystemException
{
return new TarFileObject(name, entry, this, true);
}
示例8: init
import org.apache.commons.compress.tar.TarEntry; //导入依赖的package包/类
public void init() throws FileSystemException {
super.init();
// Build the index
try {
List strongRef = new ArrayList( 100 );
TarEntry entry;
while ( ( entry = getTarFile().getNextEntry() ) != null ) {
FileName name = getFileSystemManager().resolveName( getRootName(), UriParser.encode( entry.getName() ) );
// Create the file
TarFileObject fileObj;
if ( entry.isDirectory() && getFileFromCache( name ) != null ) {
fileObj = (TarFileObject) getFileFromCache( name );
fileObj.setTarEntry( entry );
continue;
}
fileObj = createTarFileObject( name, entry );
putFileToCache( fileObj );
strongRef.add( fileObj );
fileObj.holdObject( strongRef );
// Make sure all ancestors exist
// TODO - create these on demand
TarFileObject parent = null;
for ( FileName parentName = name.getParent();
parentName != null;
fileObj = parent, parentName = parentName.getParent() ) {
// Locate the parent
parent = (TarFileObject) getFileFromCache( parentName );
if ( parent == null ) {
parent = createTarFileObject( parentName, null );
putFileToCache( parent );
strongRef.add( parent );
parent.holdObject( strongRef );
}
// Attach child to parent
parent.attachChild( fileObj.getName() );
}
}
} catch ( IOException e ) {
throw new FileSystemException( e );
} finally {
closeCommunicationLink();
}
}
示例9: createTarFileObject
import org.apache.commons.compress.tar.TarEntry; //导入依赖的package包/类
protected TarFileObject createTarFileObject( final FileName name,
final TarEntry entry ) throws FileSystemException {
return new TarFileObject( name, entry, this, true );
}