Printer.println("\n :::: RENAME( from: " + from + ", to: " + to + " )", "amarelo");
if(from.equals("/.statistics.txt"))
return 0;
String[] vec = dividePath(to);
NodeMetadata metadata=null;
if(!config.isNonSharing()){
boolean isInPNS;
try {
metadata = namespace.getMetadata(from);
isInPNS = true;
} catch (DirectoryServiceException e) {
try {
long time = System.currentTimeMillis();
metadata = directoryService.getMetadata(from);
Statistics.incGetMeta(System.currentTimeMillis() - time);
} catch (DirectoryServiceException e1) {
throw new FuseException(e.getMessage()).initErrno(FuseException.ECONNABORTED);
}
isInPNS = false;
}
try{
if(isInPNS){
namespace.updateMetadata(from, new NodeMetadata(metadata.getNodeType(), vec[0], vec[1], metadata.getStats(), metadata.getId_path(), metadata.getKey(), metadata.getC_r(), metadata.getC_w()));
}else{
NodeMetadata node=null;
node = new NodeMetadata(metadata.getNodeType(), vec[0], vec[1], metadata.getStats(), metadata.getId_path(), metadata.getKey(), metadata.getC_r(), metadata.getC_w());
long time = System.currentTimeMillis();
directoryService.updateMetadata(from, node);
Statistics.incUpdateMeta(System.currentTimeMillis() - time);
}
} catch (DirectoryServiceConnectionProblemException e) {
throw new FuseException(e.getMessage()).initErrno(FuseException.ECONNABORTED);
} catch (DirectoryServiceException e) {
throw new FuseException(e.getMessage()).initErrno(FuseException.ECONNABORTED);
}
}else{
try {
long time = System.currentTimeMillis();
metadata = directoryService.getMetadata(from);
Statistics.incGetMeta(System.currentTimeMillis() - time);
NodeMetadata node=new NodeMetadata(metadata.getNodeType(), vec[0], vec[1], metadata.getStats(), metadata.getId_path(), metadata.getKey(), metadata.getC_r(), metadata.getC_w());
time = System.currentTimeMillis();
directoryService.updateMetadata(from, node);
Statistics.incUpdateMeta(System.currentTimeMillis() - time);
} catch (DirectoryServiceException e1) {