File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
android/src/main/java/com/rnziparchive Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 55import java .io .BufferedInputStream ;
66import java .io .BufferedOutputStream ;
77import java .io .File ;
8+ import java .nio .file .Path ;
9+ import java .nio .file .Paths ;
810import java .io .FileInputStream ;
911import java .io .FileOutputStream ;
1012import java .util .Timer ;
@@ -70,7 +72,7 @@ public void run() {
7072
7173 if (!new File (absoluteFilepath ).isDirectory ()) {
7274 FileInputStream fi = new FileInputStream (absoluteFilepath );
73- String filename = absoluteFilepath . replace (fromDirectory , "" );
75+ String filename = Paths . get (fromDirectory ). relativize ( Paths . get ( absoluteFilepath )). toString ( );
7476 ZipEntry entry = new ZipEntry (filename );
7577 out .putNextEntry (entry );
7678 origin = new BufferedInputStream (fi , BUFFER_SIZE );
You can’t perform that action at this time.
0 commit comments