From 182efebb40d805fde42a423e01c80c1ed8fe754d Mon Sep 17 00:00:00 2001 From: Adam Murdoch Date: Sat, 8 Sep 2012 10:19:26 +1000 Subject: [PATCH] Added @ThreadSafe. --- src/main/java/net/rubygrapefruit/platform/FileSystem.java | 5 +++++ src/main/java/net/rubygrapefruit/platform/FileSystems.java | 2 ++ src/main/java/net/rubygrapefruit/platform/PosixFile.java | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/src/main/java/net/rubygrapefruit/platform/FileSystem.java b/src/main/java/net/rubygrapefruit/platform/FileSystem.java index 3679c28..abce8e3 100644 --- a/src/main/java/net/rubygrapefruit/platform/FileSystem.java +++ b/src/main/java/net/rubygrapefruit/platform/FileSystem.java @@ -5,24 +5,29 @@ import java.io.File; /** * Information about a file system. This is a snapshot view and does not change. */ +@ThreadSafe public interface FileSystem { /** * Returns the root directory of this file system. */ + @ThreadSafe File getMountPoint(); /** * Returns the operating system specific name for the type of this file system. */ + @ThreadSafe String getFileSystemType(); /** * Returns true if this file system is a remote file system, or false if local. */ + @ThreadSafe boolean isRemote(); /** * Returns the operating system specific name for this file system. */ + @ThreadSafe String getDeviceName(); } diff --git a/src/main/java/net/rubygrapefruit/platform/FileSystems.java b/src/main/java/net/rubygrapefruit/platform/FileSystems.java index 6411fc9..d3ad74c 100644 --- a/src/main/java/net/rubygrapefruit/platform/FileSystems.java +++ b/src/main/java/net/rubygrapefruit/platform/FileSystems.java @@ -5,11 +5,13 @@ import java.util.List; /** * Provides access to the file systems of the current machine. */ +@ThreadSafe public interface FileSystems extends NativeIntegration { /** * Returns the set of all file systems for the current machine. * * @throws NativeException On failure. */ + @ThreadSafe List getFileSystems() throws NativeException; } diff --git a/src/main/java/net/rubygrapefruit/platform/PosixFile.java b/src/main/java/net/rubygrapefruit/platform/PosixFile.java index ccae574..3b5180e 100644 --- a/src/main/java/net/rubygrapefruit/platform/PosixFile.java +++ b/src/main/java/net/rubygrapefruit/platform/PosixFile.java @@ -5,12 +5,14 @@ import java.io.File; /** * Functions to query and modify a file's POSIX meta-data. */ +@ThreadSafe public interface PosixFile extends NativeIntegration { /** * Sets the mode for the given file. * * @throws NativeException On failure. */ + @ThreadSafe void setMode(File path, int perms) throws NativeException; /** @@ -18,6 +20,7 @@ public interface PosixFile extends NativeIntegration { * * @throws NativeException On failure. */ + @ThreadSafe int getMode(File path) throws NativeException; /** @@ -25,6 +28,7 @@ public interface PosixFile extends NativeIntegration { * * @throws NativeException On failure. */ + @ThreadSafe void symlink(File link, String contents) throws NativeException; /** @@ -32,5 +36,6 @@ public interface PosixFile extends NativeIntegration { * * @throws NativeException On failure. */ + @ThreadSafe String readLink(File link) throws NativeException; }