當前位置: 首頁>>代碼示例>>Java>>正文


Java TarEntry類代碼示例

本文整理匯總了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;
}
 
開發者ID:wso2,項目名稱:wso2-commons-vfs,代碼行數:22,代碼來源:TarFileObject.java

示例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);
    }
}
 
開發者ID:wso2,項目名稱:wso2-commons-vfs,代碼行數:16,代碼來源:TarFileSystem.java

示例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;
    }
}
 
開發者ID:wso2,項目名稱:wso2-commons-vfs,代碼行數:14,代碼來源:TarFileObject.java

示例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 );
  }
}
 
開發者ID:pentaho,項目名稱:pdi-vfs,代碼行數:11,代碼來源:TarFileSystem.java

示例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;
    }
}
 
開發者ID:pentaho,項目名稱:pdi-vfs,代碼行數:14,代碼來源:TarFileObject.java

示例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();
    }
}
 
開發者ID:wso2,項目名稱:wso2-commons-vfs,代碼行數:61,代碼來源:TarFileSystem.java

示例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);
}
 
開發者ID:wso2,項目名稱:wso2-commons-vfs,代碼行數:6,代碼來源:TarFileSystem.java

示例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();
  }
}
 
開發者ID:pentaho,項目名稱:pdi-vfs,代碼行數:49,代碼來源:TarFileSystem.java

示例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 );
}
 
開發者ID:pentaho,項目名稱:pdi-vfs,代碼行數:5,代碼來源:TarFileSystem.java


注:本文中的org.apache.commons.compress.tar.TarEntry類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。