Java Code Examples for java.util.zip.ZipEntry#getComment()

The following examples show how to use java.util.zip.ZipEntry#getComment() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ZipContentLocation.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
public ZipContentLocation( ZipRepository repository, ZipContentLocation parent, ZipEntry zipEntry ) {
  if ( repository == null ) {
    throw new NullPointerException();
  }
  if ( parent == null ) {
    throw new NullPointerException();
  }
  if ( zipEntry == null ) {
    throw new NullPointerException();
  }

  this.repository = repository;
  this.parent = parent;
  this.entryName = IOUtils.getInstance().getFileName( zipEntry.getName() );
  this.comment = zipEntry.getComment();
  this.size = zipEntry.getSize();
  this.time = zipEntry.getTime();
  this.entries = new HashMap();
  this.name = RepositoryUtilities.buildName( this, "/" ) + '/';
}
 
Example 2
Source File: ZipReadContentLocation.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
public ZipReadContentLocation( ZipReadRepository repository, ZipReadContentLocation parent, ZipEntry zipEntry ) {
  if ( repository == null ) {
    throw new NullPointerException();
  }
  if ( parent == null ) {
    throw new NullPointerException();
  }
  if ( zipEntry == null ) {
    throw new NullPointerException();
  }

  this.repository = repository;
  this.parent = parent;
  this.comment = zipEntry.getComment();
  this.size = zipEntry.getSize();
  this.time = zipEntry.getTime();
  this.entries = new HashMap();
  this.entryName = IOUtils.getInstance().getFileName( zipEntry.getName() );
  this.name = RepositoryUtilities.buildName( this, "/" ) + '/';
}
 
Example 3
Source File: ZipReadContentItem.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
public ZipReadContentItem( final ZipReadRepository repository,
                           final ZipReadContentLocation parent,
                           final ZipEntry zipEntry,
                           final byte[] bytes ) {
  if ( repository == null ) {
    throw new NullPointerException();
  }
  if ( zipEntry == null ) {
    throw new NullPointerException();
  }
  if ( bytes == null ) {
    throw new NullPointerException();
  }

  this.parent = parent;
  this.repository = repository;
  this.comment = zipEntry.getComment();
  this.name = zipEntry.getName();
  this.entryName = IOUtils.getInstance().getFileName( name );
  this.size = zipEntry.getSize();
  this.time = zipEntry.getTime();
  this.rawData = bytes;
}
 
Example 4
Source File: GenAidlIntegrationTest.java    From buck with Apache License 2.0 6 votes vote down vote up
private String zipEntryDebugString(ZipEntry entryOne) {
  return "<ZE name="
      + entryOne.getName()
      + " crc="
      + entryOne.getCrc()
      + " comment="
      + entryOne.getComment()
      + " size="
      + entryOne.getSize()
      + " atime="
      + entryOne.getLastAccessTime()
      + " mtime="
      + entryOne.getLastModifiedTime()
      + " ctime="
      + entryOne.getCreationTime()
      + ">";
}
 
Example 5
Source File: GenruleIntegrationTest.java    From buck with Apache License 2.0 6 votes vote down vote up
private String zipEntryDebugString(ZipEntry entryOne) {
  return "<ZE name="
      + entryOne.getName()
      + " crc="
      + entryOne.getCrc()
      + " comment="
      + entryOne.getComment()
      + " size="
      + entryOne.getSize()
      + " atime="
      + entryOne.getLastAccessTime()
      + " mtime="
      + entryOne.getLastModifiedTime()
      + " ctime="
      + entryOne.getCreationTime();
}
 
Example 6
Source File: ZipUtil.java    From anyline with Apache License 2.0 5 votes vote down vote up
/** 
 * 取得压缩文件对象的注释 
 *  
 * @param entry 压缩文件对象 
 * @return 压缩文件对象的注释 
 */ 
public static String getEntryComment(ZipEntry entry) { 
	String result = ""; 
	try {

           result = entry.getComment();
           if(null != result) {
               result = new String(result.getBytes("GB2312"), "8859_1");
           }

	} catch (Exception e) { 
		e.printStackTrace(); 
	} 
	return result; 
}
 
Example 7
Source File: ZippedEntry.java    From rxjava2-extras with Apache License 2.0 5 votes vote down vote up
public ZippedEntry(ZipEntry e, InputStream is) {
    this.name = e.getName();
    this.time = e.getTime();
    // this.mtime = e.getLastModifiedTime();
    // this.atime = e.getLastAccessTime();
    // this.ctime = e.getCreationTime();
    this.crc = e.getCrc();
    this.size = e.getSize();
    this.csize = e.getCompressedSize();
    this.method = e.getMethod();
    this.extra = e.getExtra();
    this.comment = e.getComment();
    this.is = is;
}
 
Example 8
Source File: ZippedEntry.java    From rxjava-extras with Apache License 2.0 5 votes vote down vote up
public ZippedEntry(ZipEntry e, InputStream is) {
    this.name = e.getName();
    this.time = e.getTime();
    // this.mtime = e.getLastModifiedTime();
    // this.atime = e.getLastAccessTime();
    // this.ctime = e.getCreationTime();
    this.crc = e.getCrc();
    this.size = e.getSize();
    this.csize = e.getCompressedSize();
    this.method = e.getMethod();
    this.extra = e.getExtra();
    this.comment = e.getComment();
    this.is = is;
}
 
Example 9
Source File: ZipContentItem.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public ZipContentItem( final ZipRepository repository,
                       final ZipContentLocation parent,
                       final ZipEntry zipEntry,
                       final byte[] bytes ) {
  if ( repository == null ) {
    throw new NullPointerException();
  }
  if ( zipEntry == null ) {
    throw new NullPointerException();
  }
  if ( bytes == null ) {
    throw new NullPointerException();
  }
  if ( parent == null ) {
    throw new NullPointerException();
  }

  this.parent = parent;
  this.repository = repository;
  this.comment = zipEntry.getComment();
  this.name = RepositoryUtilities.buildName( this, "/" );
  this.entryName = IOUtils.getInstance().getFileName( name );
  this.size = zipEntry.getSize();
  this.crc32 = zipEntry.getCrc();
  this.time = zipEntry.getTime();
  this.rawData = bytes;
  final int method = zipEntry.getMethod();
  if ( method == ZipEntry.STORED || method == ZipEntry.DEFLATED ) {
    this.method = new Integer( method );
  } else {
    this.method = new Integer( ZipEntry.DEFLATED );
  }
  this.compression = Deflater.DEFAULT_COMPRESSION;
}
 
Example 10
Source File: ZipContentLocation.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
private void updateMetaData( final ZipEntry zipEntry ) {
  this.comment = zipEntry.getComment();
  this.size = zipEntry.getSize();
  this.time = zipEntry.getTime();
}
 
Example 11
Source File: ZipReadContentLocation.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
private void updateMetaData( final ZipEntry zipEntry ) {
  this.comment = zipEntry.getComment();
  this.size = zipEntry.getSize();
  this.time = zipEntry.getTime();
}