Java File Name Get getFileNameFromZipEntry(ZipEntry entry)

Here you can find the source of getFileNameFromZipEntry(ZipEntry entry)

Description

get File Name From Zip Entry

License

Open Source License

Declaration

private static String getFileNameFromZipEntry(ZipEntry entry) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.File;

import java.util.zip.ZipEntry;

public class Main {
    private static String getFileNameFromZipEntry(ZipEntry entry) {
        String fileName = entry.getName();
        int idx;//from www.j  a  v  a 2 s. c o m
        if ((idx = fileName.lastIndexOf("/")) > -1 || (idx = fileName.lastIndexOf(File.separator)) > -1) {
            fileName = fileName.substring(idx + 1);
        }
        return fileName;
    }
}

Related

  1. getFilenameForClassName(String className)
  2. getFileNameFromCanonical(String file)
  3. getFileNameFromFilePath(String filePath)
  4. getFileNameFromFilePath(String filepath)
  5. getFileNameFromFullPath(String fullPath)
  6. getFileNameInJCCTrayHome(String fileName)
  7. getFileNameList(File[] files)
  8. getFileNameList(String dir)
  9. getFileNameList(String path)