本文整理匯總了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 );
}