use of com.obs.services.model.fs.RenameRequest in project alluxio by Alluxio.
the class OBSUnderFileSystem method renameDirectory.
@Override
public boolean renameDirectory(String src, String dst) throws IOException {
if (!isEnvironmentPFS()) {
return super.renameDirectory(src, dst);
}
try {
RenameRequest request = new RenameRequest(mBucketName, stripPrefixIfPresent(src), stripPrefixIfPresent(dst));
RenameResult response = mClient.renameFolder(request);
if (isSuccessResponse(response.getStatusCode())) {
return true;
} else {
LOG.error("Failed to rename directory from {} to {}.", src, dst);
return false;
}
} catch (ObsException e) {
LOG.error("Failed to rename directory from {} to {}.", src, dst, e);
return false;
}
}
Aggregations