Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[cleanup] Improved javadoc and fixed formatting

  • Loading branch information...
commit 3eb46b5bc4128a0f99d4523cb71f373537605fc9 1 parent 5e9711a
@adamretter adamretter authored
Showing with 21 additions and 5 deletions.
  1. +21 −5 src/org/exist/security/AbstractUnixStylePermission.java
View
26 src/org/exist/security/AbstractUnixStylePermission.java
@@ -47,7 +47,8 @@
* op ::= + | - | =
* perm ::= r | s | t | w | x
*/
- private void setUnixSymbolicMode(final String symbolicMode) throws SyntaxException, PermissionDeniedException {
+ private void setUnixSymbolicMode(final String symbolicMode)
+ throws SyntaxException, PermissionDeniedException {
//TODO expand perm to full UNIX chmod i.e. perm ::= r | s | t | w | x | X | u | g | o
@@ -186,7 +187,8 @@ private void setUnixSymbolicMode(final String symbolicMode) throws SyntaxExcepti
* @deprecated setUnixSymbolicMode should be used instead
*/
@Deprecated
- private void setExistSymbolicMode(final String existSymbolicMode) throws SyntaxException, PermissionDeniedException {
+ private void setExistSymbolicMode(final String existSymbolicMode)
+ throws SyntaxException, PermissionDeniedException {
LOG.warn("Permission modes should not be set using this format '" + existSymbolicMode + "', consider using the UNIX symbolic mode instead");
@@ -227,7 +229,8 @@ private void setExistSymbolicMode(final String existSymbolicMode) throws SyntaxE
/**
* Simple symbolic mode is [rwxs-]{3}[rwxs-]{3}[rwxt-]{3}
*/
- private void setSimpleSymbolicMode(final String simpleSymbolicMode) throws SyntaxException, PermissionDeniedException {
+ private void setSimpleSymbolicMode(final String simpleSymbolicMode)
+ throws SyntaxException, PermissionDeniedException {
setMode(simpleSymbolicModeToInt(simpleSymbolicMode));
}
@@ -243,9 +246,19 @@ private void setSimpleSymbolicMode(final String simpleSymbolicMode) throws Synta
/**
* Note we dont need @PermissionRequired(user = IS_DBA | IS_OWNER) here
* because all of these methods delegate to the subclass implementation.
+ *
+ * @param modeStr The String representing a mode to set
+ *
+ * @throws org.exist.util.SyntaxException If the string syntax for the mode
+ * is not recognised. The following syntaxes are supported. Simple symbolic,
+ * Unix symbolic, eXist symbolic.
+ *
+ * @throws org.exist.security.PermissionDeniedException If you do not have
+ * permission to set the mode
*/
@Override
- public final void setMode(final String modeStr) throws SyntaxException, PermissionDeniedException {
+ public final void setMode(final String modeStr)
+ throws SyntaxException, PermissionDeniedException {
simpleSymbolicModeMatcher.reset(modeStr);
if(simpleSymbolicModeMatcher.matches()) {
@@ -325,8 +338,11 @@ public static String modeToSimpleSymbolicMode(final int mode) {
/**
* Utility function for external use
+ *
+ * @param types Types to convert to a string representation
+ * @return The string representation of the types
*/
- public static String typesToString(int types) {
+ public static String typesToString(final int types) {
final StringBuilder builder = new StringBuilder();
if((types >> 8) > 0) {
Please sign in to comment.
Something went wrong with that request. Please try again.