CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 13:39:21 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=a02da60af0fa9fe0aebd1d5565862dda02622d944ab190776b60bf680240913ca%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22eYtWmT8Oi01cW2O4yAY9uAuIo8HMCP7z%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d700b8de99c18d-BLR
revert - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static File revert(File current, File original) throws IOException {
- // do nothing if current and original path is exactly the same
- if (current.equals(original)) {
- return original;
- }
- // reverse move
- if (current.exists() && !original.exists()) {
- return moveRename(current, original);
- }
- BasicFileAttributes currentAttr = Files.readAttributes(current.toPath(), BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS);
- BasicFileAttributes originalAttr = Files.readAttributes(original.toPath(), BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS);
- // reverse symlink
- if (currentAttr.isSymbolicLink() && !originalAttr.isSymbolicLink()) {
- trash(current);
- return original;
- }
- // reverse keeplink
- if (!currentAttr.isSymbolicLink() && originalAttr.isSymbolicLink()) {
- trash(original);
- return moveRename(current, original);
- }
- // reverse copy / hardlink
- if (currentAttr.isRegularFile() && originalAttr.isRegularFile()) {
- trash(current);
- return original;
- }
- // reverse folder copy
- if (currentAttr.isDirectory() && originalAttr.isDirectory()) {
- trash(original);
- return moveRename(current, original);
- }
- throw new IllegalStateException(String.format("Cannot revert file: %s => %s", current, original));
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
π MAKE $2500 IN 15 MIN β
Working
JavaScript | 1 sec ago | 0.24 KB
-
π EASY MONEY GUIDE β
Working G
JavaScript | 5 sec ago | 0.25 KB
-
β
Make $2500 in 20 minutesβ I
JavaScript | 7 sec ago | 0.25 KB
-
π Swapzone +37% glitch
JavaScript | 10 sec ago | 0.24 KB
-
π Swapzone +37% glitch β V
JavaScript | 16 sec ago | 0.25 KB
-
β‘ Crypto Swap Glitch β
Working β‘
JavaScript | 19 sec ago | 0.24 KB
-
π Instant BTC Profit Method β
Working J
JavaScript | 20 sec ago | 0.25 KB
-
β
β Make huge profits on trading ββ Z
JavaScript | 27 sec ago | 0.25 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand