ZipEntry getName - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ZipEntry getName method.

This code example shows how to use the following methods:getName, isDirectory
		return classes;
	} 
 
	private void addClassFromJar(JarEntry jarEntry, List<Class<?>> classes) {
		if (isMatchingClass(jarEntry)) {
			String fileName = jarEntry.getName();
			if (isValidClassName(fileName)) {
				Class<?> clazz = createClass(fileName);
				if (isNotNull(clazz)) {
					classes.add(clazz);
				} 
			} 
		} 
	} 
 
	private boolean isMatchingClass(JarEntry jarEntry) {
 
		boolean retVal = false;
		if (!jarEntry.isDirectory()) {
			String name = jarEntry.getName();

6
CodeRank
This code example shows how to use the following methods:getComment, getName, getSize, getTime
      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;
  } 
 
  public String getMimeType() throws ContentIOException
  { 
    return repository.getMimeRegistry().getMimeType(this);
  } 
 
  public OutputStream getOutputStream() throws ContentIOException, IOException
  { 
7
CodeRank
This code example shows how to use the following methods:getName
 
	private ZipInputStream getFileFromZip(InputStream zipFileStream) throws FileNotFoundException, IOException {
		ZipInputStream zis = new ZipInputStream(zipFileStream);
		ZipEntry ze = null;
		while ((ze = zis.getNextEntry()) != null) {
			Log.w(TAG, "extracting file: '" + ze.getName() + "'...");
			return zis;
		} 
		return null; 
	} 
	 
	private String convertStreamToString(InputStream is) { 
	    return new Scanner(is).useDelimiter("\\A").next();
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:getName
        this.jarEntry = jarEntry;
    } 
 
    @Override 
    public String getPath() {
        return jarEntry.getName();
    } 
 
    @Override 
    public String getAbsolutePath() {
        return jarFile.getName() + "!/" + getPath();
    } 
 
    @Override 
    public InputStream getInputStream() throws IOException {
        return jarFile.getInputStream(jarEntry);
    } 
 
    @Override 
    public String getClassName(String extension) {
6
CodeRank
This code example shows how to use the following methods:getComment, getName, getSize, getTime
      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, "/") + '/';
  } 
 
  private void updateMetaData(final ZipEntry zipEntry)
  { 
    this.comment = zipEntry.getComment();
    this.size = zipEntry.getSize();
    this.time = zipEntry.getTime();
  } 
 
7
CodeRank
This code example shows how to use the following methods:getName, getSize, getTime
            ZipEntry entry, int timeToLive) {
        super(mediaType);
        this.zipFile = zipFile;
        this.entry = entry;
        Disposition disposition = new Disposition();
        disposition.setFilename(entry.getName());
        this.setDisposition(disposition);
        setSize(entry.getSize());
        setModificationDate(new Date(entry.getTime()));
 
        if (timeToLive == 0) {
            setExpirationDate(null); 
        } else if (timeToLive > 0) {
            setExpirationDate(new Date(System.currentTimeMillis()
                    + (1000L * timeToLive)));
        } 
    } 
 
    @Override 
    public InputStream getStream() throws IOException {
6
CodeRank
This code example shows how to use the following methods:getComment, getName, getSize, getTime
      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, "/") + '/';
  } 
 
  private void updateMetaData(final ZipEntry zipEntry)
  { 
    this.comment = zipEntry.getComment();
    this.size = zipEntry.getSize();
    this.time = zipEntry.getTime();
  } 
 
7
CodeRank
This code example shows how to use the following methods:getName
  final protected boolean internalOutputModifiedClass(Object cf, String name, Object mods) throws IOException {
    makeOutputJar(); 
    if (entryNames.contains(name)) {
      return false; 
    } else { 
      putNextEntry(new ZipEntry(name));
      BufferedOutputStream s = new BufferedOutputStream(outputJar);
      writeClassTo(cf, mods, s);
      s.flush();
      outputJar.closeEntry();
      return true; 
    } 
  } 
 
  /** 
   * Set the JAR Comment for the output JAR. 
   */ 
  final public void setJARComment(String comment) throws IOException, IllegalStateException {
    makeOutputJar(); 
    outputJar.setComment(comment);

6
CodeRank
This code example shows how to use the following methods:getComment, getName, getSize, getTime
      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;
  } 
 
  public String getMimeType() throws ContentIOException
  { 
    return repository.getMimeRegistry().getMimeType(this);
  } 
 
  public OutputStream getOutputStream() throws ContentIOException, IOException
6
CodeRank
This code example shows how to use the following methods:getCrc, getName, setTime
 
    /** 
     * @tests java.util.zip.ZipOutputStream#putNextEntry(java.util.zip.ZipEntry) 
     */ 
    public void test_putNextEntryLjava_util_zip_ZipEntry() throws IOException { 
        ZipEntry ze = new ZipEntry("testEntry");
        ze.setTime(System.currentTimeMillis());
        zos.putNextEntry(ze);
        zos.write("Hello World".getBytes());
        zos.closeEntry();
        zos.close();
        zis = new ZipInputStream(new ByteArrayInputStream(bos.toByteArray()));
        ZipEntry ze2 = zis.getNextEntry();
        zis.closeEntry();
        assertTrue("Failed to write correct entry", ze.getName().equals(
                ze2.getName())
                && ze.getCrc() == ze2.getCrc());
        try { 
            zos.putNextEntry(ze);
            fail("Entry with incorrect setting failed to throw exception");

6
CodeRank

Related ZipEntry getName Questions & Answers:

getName Method Overview
Returns the name of the entry.
See Code Examples for other Java 8 ZipEntry Methods: