Skip to content

Commit 13e715d

Browse files
Copilotslachiewicz
andcommitted
Deprecate thin wrapper methods that just delegate to Java Files API
Co-authored-by: slachiewicz <[email protected]>
1 parent 84b8d6e commit 13e715d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/main/java/org/codehaus/plexus/components/io/attributes/AttributeUtils.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ public static Set<PosixFilePermission> getPermissions(int mode) {
105105
return perms;
106106
}
107107

108+
/**
109+
* @deprecated Use {@link Files#readAttributes(Path, Class, java.nio.file.LinkOption...)} directly
110+
*/
111+
@Deprecated
108112
@Nonnull
109113
public static PosixFileAttributes getPosixFileAttributes(@Nonnull Path path) throws IOException {
110114
return Files.readAttributes(path, PosixFileAttributes.class, LinkOption.NOFOLLOW_LINKS);
@@ -143,6 +147,10 @@ public static boolean isUnix(Path path) {
143147
return path.getFileSystem().supportedFileAttributeViews().contains("unix");
144148
}
145149

150+
/**
151+
* @deprecated Use {@link Files#getFileAttributeView(Path, Class, java.nio.file.LinkOption...)} directly
152+
*/
153+
@Deprecated
146154
@Nullable
147155
public static FileOwnerAttributeView getFileOwnershipInfo(@Nonnull Path path) throws IOException {
148156
try {

src/main/java/org/codehaus/plexus/components/io/attributes/SymlinkUtils.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ public class SymlinkUtils {
3333
* @param symlink A path that is a symlink
3434
* @return A path that is the target of the symlink
3535
* @throws java.io.IOException
36+
* @deprecated Use {@link Files#readSymbolicLink(Path)} directly
3637
*/
38+
@Deprecated
3739
public static @Nonnull Path readSymbolicLink(@Nonnull Path symlink) throws IOException {
3840
return Files.readSymbolicLink(symlink);
3941
}
@@ -51,6 +53,10 @@ public class SymlinkUtils {
5153
return readSymbolicLink(symlink.toPath()).toFile();
5254
}
5355

56+
/**
57+
* @deprecated Use {@link Files#createSymbolicLink(Path, Path, java.nio.file.attribute.FileAttribute[])} directly
58+
*/
59+
@Deprecated
5460
public static @Nonnull Path createSymbolicLink(@Nonnull Path symlink, Path target) throws IOException {
5561
if (!Files.exists(symlink, LinkOption.NOFOLLOW_LINKS)) {
5662
return Files.createSymbolicLink(symlink, target);

0 commit comments

Comments
 (0)