Here you can find the source of getContentPath(Path zipFilePath, String contentFileName)
@Nullable
static Path getContentPath(Path zipFilePath, String contentFileName)
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.nio.file.FileSystem; import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; import javax.annotation.Nullable; public class Main { @Nullable static Path getContentPath(Path zipFilePath, String contentFileName) { try {// ww w. jav a2 s. c o m FileSystem zipFile = FileSystems.newFileSystem(zipFilePath, null); Path packagedPath = zipFile.getPath(contentFileName); if (Files.exists(packagedPath)) { return packagedPath; } else { return null; } } catch (IOException e) { throw new RuntimeException(e); } } }