From 1d7d21f5f1e06de70536f4c4c87e1f8aaafb8738 Mon Sep 17 00:00:00 2001 From: enricovianello Date: Mon, 24 Jun 2019 10:33:41 +0200 Subject: [PATCH 1/7] Migrated Jenkins configurations to the new model --- Jenkinsfile | 95 ++++++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 45 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 83ad17df..19a1dc23 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,67 +1,72 @@ pipeline { - agent { label 'maven' } - - options { - buildDiscarder(logRotator(numToKeepStr: '5')) - timeout(time: 1, unit: 'HOURS') + agent { + kubernetes { + label "storm-backend-server-${env.JOB_BASE_NAME}-${env.BUILD_NUMBER}" + cloud 'Kube mwdevel' + defaultContainer 'jnlp' + inheritFrom 'ci-template' } + } - triggers { cron('@daily') } + options { + buildDiscarder(logRotator(numToKeepStr: '5')) + timeout(time: 1, unit: 'HOURS') + } - stages { + triggers { cron('@daily') } - stage('build') { - steps { - container('maven-runner') { - sh 'mvn -B clean compile' - } + stages { + + stage('build') { + steps { + container('runner') { + sh 'mvn -B clean compile' } } + } - stage('test') { - steps { - container('maven-runner') { - sh 'mvn -B clean test' - } - script { - currentBuild.result = 'SUCCESS' - } + stage('test') { + steps { + container('runner') { + sh 'mvn -B clean test' } - - post { - always { - container('maven-runner') { - junit '**/target/surefire-reports/TEST-*.xml' - } - } + script { + currentBuild.result = 'SUCCESS' } } - - - stage('package') { - steps { - container('maven-runner') { - sh 'mvn -B -DskipTests=true clean package' + + post { + always { + container('runner') { + junit '**/target/surefire-reports/TEST-*.xml' } } } } - post { - failure { - slackSend color: 'danger', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Failure (<${env.BUILD_URL}|Open>)" - } - unstable { - slackSend color: 'warning', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Unstable (<${env.BUILD_URL}|Open>)" - } - changed { - script{ - if('SUCCESS'.equals(currentBuild.result)) { - slackSend color: 'good', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Back to normal (<${env.BUILD_URL}|Open>)" - } + stage('package') { + steps { + container('runner') { + sh 'mvn -B -DskipTests=true clean package' } } } + } + post { + failure { + slackSend color: 'danger', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Failure (<${env.BUILD_URL}|Open>)" + } + unstable { + slackSend color: 'warning', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Unstable (<${env.BUILD_URL}|Open>)" + } + changed { + script{ + if('SUCCESS'.equals(currentBuild.result)) { + slackSend color: 'good', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Back to normal (<${env.BUILD_URL}|Open>)" + } + } + } + } } From 9b47471a2b4f40c9bff319701411b067a71705fb Mon Sep 17 00:00:00 2001 From: enricovianello Date: Mon, 24 Jun 2019 12:30:01 +0200 Subject: [PATCH 2/7] Replaced JOB_BASE_NAME with JOB_NAME in Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 19a1dc23..fdb94a54 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent { kubernetes { - label "storm-backend-server-${env.JOB_BASE_NAME}-${env.BUILD_NUMBER}" + label "${env.JOB_NAME}-${env.BUILD_NUMBER}" cloud 'Kube mwdevel' defaultContainer 'jnlp' inheritFrom 'ci-template' From bd4c35ab247bc11286c7fcc663f5e17017682db0 Mon Sep 17 00:00:00 2001 From: enricovianello Date: Mon, 24 Jun 2019 12:40:08 +0200 Subject: [PATCH 3/7] Back to JOB_BASE_NAME --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fdb94a54..c96adcdd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent { kubernetes { - label "${env.JOB_NAME}-${env.BUILD_NUMBER}" + label "storm-backend-server_{env.JOB_BASE_NAME}-${env.BUILD_NUMBER}" cloud 'Kube mwdevel' defaultContainer 'jnlp' inheritFrom 'ci-template' From b7191e92be31b45de685579a03391e4e67a2c44e Mon Sep 17 00:00:00 2001 From: enricovianello Date: Mon, 24 Jun 2019 14:10:55 +0200 Subject: [PATCH 4/7] Fixed pod label --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c96adcdd..cc388f44 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,10 @@ +def podLabel = 'storm-backend-server_' + JOB_BASE_NAME.replaceAll('%2F','').replaceAll("[^a-zA-Z0-9]+","") + '-' + BUILD_NUMBER + pipeline { agent { kubernetes { - label "storm-backend-server_{env.JOB_BASE_NAME}-${env.BUILD_NUMBER}" + label "${podLabel}" cloud 'Kube mwdevel' defaultContainer 'jnlp' inheritFrom 'ci-template' From 57dd8bbcfb713ac7477744c84b6d486628d23601 Mon Sep 17 00:00:00 2001 From: enricovianello Date: Mon, 24 Jun 2019 17:09:37 +0200 Subject: [PATCH 5/7] Use sd jenkins library --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cc388f44..312c9840 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,10 +1,11 @@ -def podLabel = 'storm-backend-server_' + JOB_BASE_NAME.replaceAll('%2F','').replaceAll("[^a-zA-Z0-9]+","") + '-' + BUILD_NUMBER +@Library('sd')_ +def kubeLabel = getKubeLabel() pipeline { agent { kubernetes { - label "${podLabel}" + label "${kubeLabel}" cloud 'Kube mwdevel' defaultContainer 'jnlp' inheritFrom 'ci-template' From a1579b15c4eb71cb63265435e8ab74b149a981d8 Mon Sep 17 00:00:00 2001 From: enricovianello Date: Mon, 15 Jul 2019 15:32:54 +0200 Subject: [PATCH 6/7] Fix for https://issues.infn.it/jira/browse/STOR-1099 --- pom.xml | 2 +- .../command/directory/MkdirCommand.java | 242 ++++++++++-------- 2 files changed, 138 insertions(+), 106 deletions(-) diff --git a/pom.xml b/pom.xml index 90dc3a3f..6963cc46 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ StoRM Backend server org.italiangrid.storm storm-backend-server - 1.11.15 + 1.11.16 diff --git a/src/main/java/it/grid/storm/synchcall/command/directory/MkdirCommand.java b/src/main/java/it/grid/storm/synchcall/command/directory/MkdirCommand.java index d7d562bc..57bb97cf 100644 --- a/src/main/java/it/grid/storm/synchcall/command/directory/MkdirCommand.java +++ b/src/main/java/it/grid/storm/synchcall/command/directory/MkdirCommand.java @@ -52,6 +52,18 @@ import it.grid.storm.synchcall.data.directory.MkdirInputData; import it.grid.storm.synchcall.data.directory.MkdirOutputData; +import static it.grid.storm.srm.types.TStatusCode.SRM_AUTHORIZATION_FAILURE; +import static it.grid.storm.srm.types.TStatusCode.SRM_DUPLICATION_ERROR; +import static it.grid.storm.srm.types.TStatusCode.SRM_FAILURE; +import static it.grid.storm.srm.types.TStatusCode.SRM_INTERNAL_ERROR; +import static it.grid.storm.srm.types.TStatusCode.SRM_INVALID_PATH; +import static it.grid.storm.synchcall.command.directory.MkdirException.srmAuthorizationFailure; +import static it.grid.storm.synchcall.command.directory.MkdirException.srmDuplicationError; +import static it.grid.storm.synchcall.command.directory.MkdirException.srmFailure; +import static it.grid.storm.synchcall.command.directory.MkdirException.srmInternalError; +import static it.grid.storm.synchcall.command.directory.MkdirException.srmInvalidPath; +import static java.lang.String.format; + import java.util.Arrays; import org.slf4j.Logger; @@ -59,12 +71,32 @@ class MkdirException extends SRMCommandException { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; + + private MkdirException(TStatusCode code, String message) { + + super(code, message); + } + + public static MkdirException srmInvalidPath(String message) { + return new MkdirException(SRM_INVALID_PATH, message); + } + + public static MkdirException srmDuplicationError(String message) { + return new MkdirException(SRM_DUPLICATION_ERROR, message); + } + + public static MkdirException srmInternalError(String message) { + return new MkdirException(SRM_INTERNAL_ERROR, message); + } - public MkdirException(TStatusCode code, String message) { + public static MkdirException srmFailure(String message) { + return new MkdirException(SRM_FAILURE, message); + } - super(code, message); - } + public static MkdirException srmAuthorizationFailure(String message) { + return new MkdirException(SRM_AUTHORIZATION_FAILURE, message); + } } /** @@ -76,9 +108,9 @@ public MkdirException(TStatusCode code, String message) { */ public class MkdirCommand extends DirectoryCommand implements Command { - - public static final Logger log = LoggerFactory.getLogger(MkdirCommand.class); - + + public static final Logger log = LoggerFactory.getLogger(MkdirCommand.class); + private static final String SRM_COMMAND = "SrmMkdir"; private final NamespaceInterface namespace; @@ -86,12 +118,11 @@ public MkdirCommand() { namespace = NamespaceDirector.getNamespace(); } - + /** * Method that provide SrmMkdir functionality. * - * @param inputData - * Contains information about input data for Mkdir request. + * @param inputData Contains information about input data for Mkdir request. * @return MkdirOutputData Contains output data */ public OutputData execute(InputData data) { @@ -106,7 +137,7 @@ public OutputData execute(InputData data) { } private MkdirOutputData doMkdir(MkdirInputData data) { - + TSURL surl = null; GridUserInterface user = null; StoRI stori = null; @@ -116,18 +147,15 @@ private MkdirOutputData doMkdir(MkdirInputData data) { user = getUser(data); stori = resolveStoRI(surl, user); checkUserAuthorization(stori, user); - log.debug("srmMkdir authorized for {} for directory = {}", - userToString(user), stori.getPFN()); + log.debug("srmMkdir authorized for {} for directory = {}", userToString(user), stori.getPFN()); createFolder(stori.getLocalFile()); - returnStatus = new TReturnStatus(TStatusCode.SRM_SUCCESS, - "Directory created with success"); + returnStatus = new TReturnStatus(TStatusCode.SRM_SUCCESS, "Directory created with success"); log.debug("srmMkdir: updating used space info ..."); try { increaseUsedSpaceInfo(stori.getLocalFile()); } catch (NamespaceException e) { log.error("srmMkdir: {}", e.getMessage()); - returnStatus.extendExplaination("Unable to increase used space info: " - + e.getMessage()); + returnStatus.extendExplaination("Unable to increase used space info: " + e.getMessage()); } log.debug("srmMkdir: managing ACL ..."); try { @@ -143,30 +171,54 @@ private MkdirOutputData doMkdir(MkdirInputData data) { log.debug("srmMkdir return status: {}", returnStatus); return new MkdirOutputData(returnStatus); } - + private void createFolder(LocalFile file) throws MkdirException { - LocalFile parent = file.getParentFile(); - log.debug("srmMkdir: Parent directory is {}", parent); - if (parent == null) { - throw new MkdirException(TStatusCode.SRM_INVALID_PATH, - "Parent directory does not exists. Recursive directory creation Not Allowed"); + boolean response = false; + + try { + response = file.mkdir(); + } catch (SecurityException e) { + log.error(e.getMessage(), e); + throw srmInternalError(e.getMessage()); } - if (!file.mkdir()) { - if (file.isDirectory()) { - log.debug("srmMkdir: The specified path is an existent directory."); - throw new MkdirException(TStatusCode.SRM_DUPLICATION_ERROR, - "Directory specified exists!"); + + if (!response) { + log.debug("SrmMkdir: Request failed!"); + if (file.exists()) { + log.debug("srmMkdir: {} exists", file); + if (file.isDirectory()) { + log.debug("srmMkdir: {} is a directory", file); + throw srmDuplicationError(format("Path %s exists and it's a directory.", file)); + } + log.debug("srmMkdir: {} is a file", file); + throw srmInvalidPath(format("Path %s exists and it's a file.", file)); } - log.debug("srmMkdir: The specified path is an existent file."); - throw new MkdirException(TStatusCode.SRM_INVALID_PATH, - "Path specified exists as a file"); + log.debug("srmMkdir: {} doesn't exist", file); + LocalFile parent = file.getParentFile(); + if (parent == null) { + log.debug("srmMkdir: null Parent directory. Is {} a root directory?", file); + throw srmInternalError("Unexpected null parent directory"); + } + log.debug("srmMkdir: Parent directory is {}", parent); + if (!parent.exists()) { + log.debug("srmMkdir: Parent directory {} doesn't exist.", parent); + throw srmInvalidPath("Parent directory doesn't exist. Recursive directory creation Not Allowed"); + } + log.debug("srmMkdir: Parent directory {} exists.", parent); + if (!parent.isDirectory()) { + log.debug("srmMkdir: Parent directory {} is not a directory.", parent); + throw srmInvalidPath("Parent directory is not a directory."); + } + throw srmInternalError("Parent directory exists but some other unexpected error occoured."); } + log.debug("SrmMkdir: Request success!"); + return; } -private void checkInputData(InputData data) throws IllegalArgumentException { - + private void checkInputData(InputData data) throws IllegalArgumentException { + if (data == null) { throw new IllegalArgumentException("Invalid input data: NULL"); } @@ -174,56 +226,51 @@ private void checkInputData(InputData data) throws IllegalArgumentException { throw new IllegalArgumentException("Invalid input data type"); } } - + private TSURL getSURL(MkdirInputData data) throws MkdirException { - + TSURL surl = data.getSurl(); if (surl == null) { - throw new MkdirException(TStatusCode.SRM_FAILURE, - "SURL specified is NULL"); + throw srmFailure("SURL specified is NULL"); } if (surl.isEmpty()) { - throw new MkdirException(TStatusCode.SRM_FAILURE, - "SURL specified is empty"); + throw srmFailure("SURL specified is empty"); } return surl; } - - private StoRI resolveStoRI(TSURL surl, GridUserInterface user) - throws MkdirException { + + private StoRI resolveStoRI(TSURL surl, GridUserInterface user) throws MkdirException { try { return namespace.resolveStoRIbySURL(surl, user); } catch (UnapprochableSurlException e) { log.error(e.getMessage()); - throw new MkdirException(TStatusCode.SRM_AUTHORIZATION_FAILURE, - e.getMessage()); - } catch (NamespaceException e) { + throw srmAuthorizationFailure(e.getMessage()); + } catch (NamespaceException e) { log.error(e.getMessage()); - throw new MkdirException(TStatusCode.SRM_INTERNAL_ERROR, e.getMessage()); - } catch (InvalidSURLException e) { + throw srmInternalError(e.getMessage()); + } catch (InvalidSURLException e) { log.error(e.getMessage()); - throw new MkdirException(TStatusCode.SRM_INVALID_PATH, e.getMessage()); - } catch (IllegalArgumentException e) { + throw srmInvalidPath(e.getMessage()); + } catch (IllegalArgumentException e) { log.error(e.getMessage()); - throw new MkdirException(TStatusCode.SRM_INTERNAL_ERROR, e.getMessage()); + throw srmInternalError(e.getMessage()); } } - + private boolean isAnonymous(GridUserInterface user) { - + return (user == null); } - - private void checkUserAuthorization(StoRI stori, GridUserInterface user) - throws MkdirException { - + + private void checkUserAuthorization(StoRI stori, GridUserInterface user) throws MkdirException { + TSpaceToken token; try { token = stori.getVirtualFileSystem().getSpaceToken(); } catch (NamespaceException e) { log.error(e.getMessage()); - throw new MkdirException(TStatusCode.SRM_INTERNAL_ERROR, e.getMessage()); + throw srmInternalError(e.getMessage()); } SpaceAuthzInterface spaceAuth = AuthzDirector.getSpaceAuthz(token); @@ -234,49 +281,43 @@ private void checkUserAuthorization(StoRI stori, GridUserInterface user) isSpaceAuthorized = spaceAuth.authorize(user, SRMSpaceRequest.MD); } if (!isSpaceAuthorized) { - log.debug("srmMkdir: User not authorized to perform srmMkdir request " - + "on the storage area: {}", token); - throw new MkdirException(TStatusCode.SRM_AUTHORIZATION_FAILURE, - "User is not authorized to create a directory on the storage area " - + token); + String msg = format("User not authorized to perform srmMkdir request on the storage area: %s", token); + log.debug("srmMkdir:{}", msg); + throw srmAuthorizationFailure(msg); } AuthzDecision decision; if (isAnonymous(user)) { - decision = AuthzDirector.getPathAuthz().authorizeAnonymous( - SRMFileRequest.MD, stori.getStFN()); - } else { - decision = AuthzDirector.getPathAuthz().authorize(user, - SRMFileRequest.MD, stori); + decision = AuthzDirector.getPathAuthz().authorizeAnonymous(SRMFileRequest.MD, stori.getStFN()); + } else { + decision = AuthzDirector.getPathAuthz().authorize(user, SRMFileRequest.MD, stori); } if (!decision.equals(AuthzDecision.PERMIT)) { - log.debug("srmMkdir: User is not authorized to make a new directory"); - throw new MkdirException(TStatusCode.SRM_AUTHORIZATION_FAILURE, - "User is not authorized to create a directory"); + String msg = "User is not authorized to make a new directory"; + log.debug("srmMkdir: {}", msg); + throw srmAuthorizationFailure(msg); } } - + private String userToString(GridUserInterface user) { - + return isAnonymous(user) ? "anonymous" : user.getDn(); } - + private GridUserInterface getUser(InputData data) { - + if (data instanceof IdentityInputData) { return ((IdentityInputData) data).getUser(); } return null; } - + private void increaseUsedSpaceInfo(LocalFile dir) throws NamespaceException { - - NamespaceDirector.getNamespace().resolveVFSbyLocalFile(dir) - .increaseUsedSpace(dir.getSize()); + + NamespaceDirector.getNamespace().resolveVFSbyLocalFile(dir).increaseUsedSpace(dir.getSize()); } - private void manageAcl(StoRI stori, GridUserInterface user, - TReturnStatus returnStatus) throws Exception { + private void manageAcl(StoRI stori, GridUserInterface user, TReturnStatus returnStatus) throws Exception { FilesystemPermission permission; if (Configuration.getInstance().getEnableWritePermOnDirectory()) { @@ -293,19 +334,17 @@ private void manageAcl(StoRI stori, GridUserInterface user, } } - private void setAcl(GridUserInterface user, LocalFile file, - boolean hasJiTACL, FilesystemPermission permission) throws Exception { + private void setAcl(GridUserInterface user, LocalFile file, boolean hasJiTACL, FilesystemPermission permission) + throws Exception { /* * Add Acces Control List (ACL) in directory created. ACL allow user to - * read-write-list the new directory Call wrapper to set ACL on file - * created. + * read-write-list the new directory Call wrapper to set ACL on file created. */ log.debug("SrmMkdir: Adding ACL for directory '{}' group:g_name:--x", file); /* - * Set permission on directory In case of local auth source enable also - * write + * Set permission on directory In case of local auth source enable also write */ if (hasJiTACL) { // Jit Case: with JiT Model the ACL for directory is not needed. @@ -323,12 +362,10 @@ private void setAcl(GridUserInterface user, LocalFile file, throw new Exception("ACL setup error. Invalid local user."); } } - AclManagerFS.getInstance().grantGroupPermission(file, localUser, - permission); + AclManagerFS.getInstance().grantGroupPermission(file, localUser, permission); } - private void manageDefaultACL(LocalFile dir, FilesystemPermission permission) - throws Exception { + private void manageDefaultACL(LocalFile dir, FilesystemPermission permission) throws Exception { VirtualFSInterface vfs; try { @@ -344,34 +381,29 @@ private void manageDefaultACL(LocalFile dir, FilesystemPermission permission) } for (ACLEntry ace : dacl.getACL()) { /* - * TODO ATTENTION: here we never set the acl contained in the ACE, we just - * add xr or xrw in respect to getEnableWritePermOnDirectory + * TODO ATTENTION: here we never set the acl contained in the ACE, we just add + * xr or xrw in respect to getEnableWritePermOnDirectory */ - log.debug("Adding DefaultACL for the gid: {} with permission: {}", - ace.getGroupID(), ace.getFilePermissionString()); + log.debug("Adding DefaultACL for the gid: {} with permission: {}", ace.getGroupID(), + ace.getFilePermissionString()); LocalUser user = new LocalUser(ace.getGroupID(), ace.getGroupID()); - AclManagerFS.getInstance().grantGroupPermission(dir, user, - permission); + AclManagerFS.getInstance().grantGroupPermission(dir, user, permission); } } - private void setHttpsServiceAcl(LocalFile file, - FilesystemPermission permission) { + private void setHttpsServiceAcl(LocalFile file, FilesystemPermission permission) { - log.debug("SrmMkdir: Adding default ACL for directory {}: {}", file, - permission); - AclManagerFS.getInstance().grantHttpsServiceGroupPermission(file, - permission); + log.debug("SrmMkdir: Adding default ACL for directory {}: {}", file, permission); + AclManagerFS.getInstance().grantHttpsServiceGroupPermission(file, permission); } - private void printRequestOutcome(TReturnStatus status, - MkdirInputData inputData) { + private void printRequestOutcome(TReturnStatus status, MkdirInputData inputData) { if (inputData != null) { if (inputData.getSurl() != null) { CommandHelper.printRequestOutcome(SRM_COMMAND, log, status, inputData, - Arrays.asList(inputData.getSurl().toString())); + Arrays.asList(inputData.getSurl().toString())); } else { CommandHelper.printRequestOutcome(SRM_COMMAND, log, status, inputData); } From 5b3936c7eb85193ce6b74d0d8dcd899a3107ddde Mon Sep 17 00:00:00 2001 From: enricovianello Date: Mon, 15 Jul 2019 17:12:47 +0200 Subject: [PATCH 7/7] Cosmetic fixes on error messages --- .../command/directory/MkdirCommand.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/it/grid/storm/synchcall/command/directory/MkdirCommand.java b/src/main/java/it/grid/storm/synchcall/command/directory/MkdirCommand.java index 57bb97cf..482ecbd6 100644 --- a/src/main/java/it/grid/storm/synchcall/command/directory/MkdirCommand.java +++ b/src/main/java/it/grid/storm/synchcall/command/directory/MkdirCommand.java @@ -186,34 +186,34 @@ private void createFolder(LocalFile file) throws MkdirException { if (!response) { log.debug("SrmMkdir: Request failed!"); if (file.exists()) { - log.debug("srmMkdir: {} exists", file); + log.debug("srmMkdir: {} exists", file.getPath()); if (file.isDirectory()) { - log.debug("srmMkdir: {} is a directory", file); - throw srmDuplicationError(format("Path %s exists and it's a directory.", file)); + log.debug("srmMkdir: {} is a directory", file.getPath()); + throw srmDuplicationError("Path exists and it's a directory."); } log.debug("srmMkdir: {} is a file", file); - throw srmInvalidPath(format("Path %s exists and it's a file.", file)); + throw srmInvalidPath("Path exists and it's a file."); } - log.debug("srmMkdir: {} doesn't exist", file); + log.debug("srmMkdir: {} doesn't exist", file.getPath()); LocalFile parent = file.getParentFile(); if (parent == null) { - log.debug("srmMkdir: null Parent directory. Is {} a root directory?", file); + log.debug("srmMkdir: null Parent directory. Is {} a root directory?", file.getPath()); throw srmInternalError("Unexpected null parent directory"); } - log.debug("srmMkdir: Parent directory is {}", parent); + log.debug("srmMkdir: Parent directory is {}", parent.getPath()); if (!parent.exists()) { - log.debug("srmMkdir: Parent directory {} doesn't exist.", parent); + log.debug("srmMkdir: Parent directory {} doesn't exist.", parent.getPath()); throw srmInvalidPath("Parent directory doesn't exist. Recursive directory creation Not Allowed"); } - log.debug("srmMkdir: Parent directory {} exists.", parent); + log.debug("srmMkdir: Parent directory {} exists.", parent.getPath()); if (!parent.isDirectory()) { - log.debug("srmMkdir: Parent directory {} is not a directory.", parent); + log.debug("srmMkdir: Parent directory {} is not a directory.", parent.getPath()); throw srmInvalidPath("Parent directory is not a directory."); } throw srmInternalError("Parent directory exists but some other unexpected error occoured."); } - log.debug("SrmMkdir: Request success!"); + log.debug("SrmMkdir: Request successful!"); return; }