Skip to content

Introduce new constant to indicate uknown octal mode for resources #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public Java7FileAttributes(@Nonnull File file, @Nonnull Map<Integer, String> use
userId = null;
this.groupName = null;
this.groupId = null;
octalMode = -1;
octalMode = PlexusIoResourceAttributes.UNKNOWN_OCTAL_MODE;
permissions = Collections.emptySet();
symbolicLink = Files.isSymbolicLink(path);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

public interface PlexusIoResourceAttributes
{
int UNKNOWN_OCTAL_MODE = -1;

boolean isOwnerReadable();

boolean isOwnerWritable();
Expand Down Expand Up @@ -66,9 +68,9 @@ public interface PlexusIoResourceAttributes
@Nullable
String getGroupName();

/*
/**
* Octal mode attributes.
* -1 if unsupported on current file/file system
* {@link #UNKNOWN_OCTAL_MODE} if unsupported on current file/file system
*/
int getOctalMode();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class SimpleResourceAttributes

private String groupName;

private int mode = -1;
private int mode = PlexusIoResourceAttributes.UNKNOWN_OCTAL_MODE;

private boolean isSymbolicLink;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ public void setOverrideAttributes( final int uid, final String userName, final i
private static PlexusIoResourceAttributes createDefaults( final int uid, final String userName, final int gid,
final String groupName, final int mode )
{
return new SimpleResourceAttributes( uid, userName, gid, groupName, mode >= 0 ? mode : -1 );
return new SimpleResourceAttributes( uid, userName, gid, groupName,
mode >= 0 ? mode : PlexusIoResourceAttributes.UNKNOWN_OCTAL_MODE );
}


Expand Down