33
33
import java .io .Reader ;
34
34
import java .lang .invoke .MethodHandles ;
35
35
import java .lang .reflect .Constructor ;
36
- import java .lang .reflect .Field ;
37
36
import java .lang .reflect .Method ;
38
37
import java .lang .reflect .ReflectPermission ;
39
38
import java .nio .channels .FileChannel ;
@@ -354,10 +353,6 @@ static void setUncaughtExceptionHandler(Thread thread, Thread.UncaughtExceptionH
354
353
doPrivileged (() -> thread .setUncaughtExceptionHandler (eh ), new RuntimePermission ("modifyThread" ));
355
354
}
356
355
357
- static void moveReplace (SafePath from , SafePath to ) throws IOException {
358
- doPrivilegedIOWithReturn (() -> Files .move (from .toPath (), to .toPath ()));
359
- }
360
-
361
356
static void clearDirectory (SafePath safePath ) throws IOException {
362
357
doPriviligedIO (() -> Files .walkFileTree (safePath .toPath (), new DirectoryCleaner ()));
363
358
}
@@ -404,10 +399,6 @@ static boolean isWritable(SafePath safePath) throws IOException {
404
399
return doPrivilegedIOWithReturn (() -> Files .isWritable (safePath .toPath ()));
405
400
}
406
401
407
- static void deleteOnExit (SafePath safePath ) {
408
- doPrivileged (() -> safePath .toPath ().toFile ().deleteOnExit ());
409
- }
410
-
411
402
static ReadableByteChannel newFileChannelToRead (SafePath safePath ) throws IOException {
412
403
return doPrivilegedIOWithReturn (() -> FileChannel .open (safePath .toPath (), StandardOpenOption .READ ));
413
404
}
@@ -420,10 +411,6 @@ public static Reader newFileReader(SafePath safePath) throws FileNotFoundExcepti
420
411
return doPrivilegedIOWithReturn (() -> Files .newBufferedReader (safePath .toPath ()));
421
412
}
422
413
423
- static void touch (SafePath path ) throws IOException {
424
- doPriviligedIO (() -> new RandomAccessFile (path .toPath ().toFile (), "rw" ).close ());
425
- }
426
-
427
414
static void setAccessible (Method method ) {
428
415
doPrivileged (() -> method .setAccessible (true ), new ReflectPermission ("suppressAccessChecks" ));
429
416
}
0 commit comments