Commit da49ff72 authored by Rina Sergeeva's avatar Rina Sergeeva

fix

parent 485546b1
......@@ -43,7 +43,7 @@ public class FileSearcher {
* но сейчас нет разницы - обычный это файл или архив
* */
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs){
if(unzipUtil.isZip(file.toFile())) {
Set<File> unzipFiles = unzipUtil.unzipArchive(file.toFile());
foundedFiles.addAll(unzipFiles);
......@@ -61,12 +61,12 @@ public class FileSearcher {
*
*/
@Override
public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
public FileVisitResult visitFileFailed(Path file, IOException exc){
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
public FileVisitResult postVisitDirectory(Path dir, IOException exc){
return FileVisitResult.CONTINUE;
}
});
......
......@@ -58,7 +58,7 @@ public class UnzipUtil {
return unzipFiles;
}
boolean isZip(File file) {
public boolean isZip(File file) {
if(file.isDirectory()){
return false;
}
......@@ -66,7 +66,7 @@ public class UnzipUtil {
return extension.equals(".zip") || extension.equals(".zipx") || extension.equals(".gzip") || extension.equals(".rar");
}
private static void write(InputStream inputStream, OutputStream outputStream) throws IOException {
private void write(InputStream inputStream, OutputStream outputStream) throws IOException {
byte[] buffer = new byte[1024];
int len;
while ((len = inputStream.read(buffer)) >= 0)
......@@ -75,10 +75,12 @@ public class UnzipUtil {
inputStream.close();
}
public static void deleteUnzipFiles() {
public void deleteUnzipFiles() {
unzipDirs.forEach((p) -> {
if (!p.delete()) {
logger.error("Directory " + p + " does not deleted!\n");
}else{
unzipDirs.remove(p);
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment