소스 검색

Added cleanup to TemporaryMountPointChooser

JaniruTEC 4 년 전
부모
커밋
b7f2fb0bdf
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      main/commons/src/main/java/org/cryptomator/common/mountpoint/TemporaryMountPointChooser.java

+ 10 - 0
main/commons/src/main/java/org/cryptomator/common/mountpoint/TemporaryMountPointChooser.java

@@ -73,6 +73,16 @@ public class TemporaryMountPointChooser implements MountPointChooser {
 		}
 	}
 
+	@Override
+	public void cleanup(Path mountPoint) {
+		try {
+			Files.delete(mountPoint);
+			LOG.debug("Successfully deleted mount point: {}", mountPoint);
+		} catch (IOException e) {
+			LOG.warn("Could not delete mount point: {}", e.getMessage());
+		}
+	}
+
 	private InvalidMountPointException wrapAsIMPE(Exception exception) {
 		return new InvalidMountPointException(exception);
 	}