当前位置: 首页>>代码示例>>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;未经允许,请勿转载。