aboutsummaryrefslogtreecommitdiff
path: root/jimfs/src/main
diff options
context:
space:
mode:
authorColin Decker <cgdecker@google.com>2013-10-18 11:29:18 -0400
committerColin Decker <cgdecker@google.com>2013-10-18 11:29:18 -0400
commit00f243cb657c0bfb4829f839600c0a48c26c6585 (patch)
treeb403cd4f0771afeb7b41af7bebb26bab956c0fff /jimfs/src/main
parent1bed38c5a9cdf6b30a89cd3d75d21e9e5d58afab (diff)
downloadjimfs-00f243cb657c0bfb4829f839600c0a48c26c6585.tar.gz
Make the Windows path syntax "\foo\bar" (absolute path on current drive) explicitly unsupported.
Also clean up a few TODOs.
Diffstat (limited to 'jimfs/src/main')
-rw-r--r--jimfs/src/main/java/com/google/jimfs/internal/AbstractWatchService.java4
-rw-r--r--jimfs/src/main/java/com/google/jimfs/path/WindowsPathType.java7
2 files changed, 7 insertions, 4 deletions
diff --git a/jimfs/src/main/java/com/google/jimfs/internal/AbstractWatchService.java b/jimfs/src/main/java/com/google/jimfs/internal/AbstractWatchService.java
index 999e07a..bcc2c61 100644
--- a/jimfs/src/main/java/com/google/jimfs/internal/AbstractWatchService.java
+++ b/jimfs/src/main/java/com/google/jimfs/internal/AbstractWatchService.java
@@ -150,8 +150,8 @@ abstract class AbstractWatchService implements WatchService {
@Override
public void close() {
if (open.compareAndSet(true, false)) {
- // TODO(cgdecker): If there's a better way to guarantee that no thread is blocked on the queue
- // after this is closed I'd love to know
+ // TODO(cgdecker): If there's a better way to guarantee that no thread is blocked on the
+ // queue after this is closed I'd love to know
// Attempt to acquire the write lock... each time we fail, there may be threads blocked
// on the queue (if none are blocked, they will be blocked soon)
diff --git a/jimfs/src/main/java/com/google/jimfs/path/WindowsPathType.java b/jimfs/src/main/java/com/google/jimfs/path/WindowsPathType.java
index 72a3f81..fe85d9f 100644
--- a/jimfs/src/main/java/com/google/jimfs/path/WindowsPathType.java
+++ b/jimfs/src/main/java/com/google/jimfs/path/WindowsPathType.java
@@ -67,13 +67,16 @@ final class WindowsPathType extends PathType {
path = path.replace('/', '\\');
if (WORKING_DIR_WITH_DRIVE.matcher(path).matches()) {
- throw new InvalidPathException(original,
- "JIMFS does not currently support the Windows \"relative path with drive\" syntax");
+ throw new InvalidPathException(original, "JIMFS does not currently support the Windows "
+ + "syntax for a relative path on a specific drive (e.g. \"C:foo\\bar\"");
}
String root;
if (path.startsWith("\\\\")) {
root = parseUncRoot(path, original);
+ } else if (path.startsWith("\\")) {
+ throw new InvalidPathException(original, "JIMFS does not currently support the Windows "
+ + "syntax for an absolute path on the current drive (e.g. \"\\foo\\bar\"");
} else {
root = parseDriveRoot(path);
}