Skip to content

Commit

Permalink
Remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
mukoki committed Mar 27, 2022
1 parent 86fd3b7 commit 2196719
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
5 changes: 3 additions & 2 deletions src/com/vividsolutions/jump/coordsys/EsriProj.java
Expand Up @@ -76,8 +76,9 @@ public static String findProj(final int id) throws IOException, ArchiveException
String proj = PROJMAP.get(id);
if (proj == null) proj = PROJMAP.get(id);
if (proj == null) {
InputStream fis = new FileInputStream(projfile);
InputStream is = CompressedFile.getUncompressedStream(fis, entryName);
//InputStream fis = new FileInputStream(projfile);
//InputStream is = CompressedFile.getUncompressedStream(fis, entryName);
InputStream is = CompressedFile.openFile(projfile.getPath(), entryName);
BufferedReader br = new BufferedReader(new InputStreamReader(is));

Optional<String[]> tokens = br.lines()
Expand Down
26 changes: 0 additions & 26 deletions src/com/vividsolutions/jump/io/CompressedFile.java
Expand Up @@ -280,32 +280,6 @@ else if (isSevenZ(filePath)) {

}

/**
* Returns an uncompressed stream from a compressed stream and an entry name.
* This is a part of openFile method you can use if you know your input is
* compressed with the following benefits :
* <ul>
* <li>input is just an InputStream</li>
* <li>faster</li>
* </ul>
*
* @param is input stream containing compressed data (from URL, jar, file...)
* @param entryName entry name in the compressed stream
* @return uncompressed inputstream for the entry
* @throws IOException if the input stream cannot be read
* @throws ArchiveException if an exception occurs during decompression
*/
public static InputStream getUncompressedStream(InputStream is, String entryName) throws IOException, ArchiveException {
InputStream bis = is instanceof FilterInputStream ? is : new BufferedInputStream(is);
ArchiveInputStream ais = new ArchiveStreamFactory().createArchiveInputStream(bis);
ArchiveEntry entry;
while ((entry = ais.getNextEntry()) != null) {
if (entry.getName().equals(entryName))
return ais;
}
bis.close();
return null;
}

public static boolean isCompressed(URI uri) {
String filepath = UriUtil.getFilePath(uri);
Expand Down

0 comments on commit 2196719

Please sign in to comment.