Ejemplo n.º 1
0
 @Override
 protected ProxyNode doCreateNew(String type, String optNewName) throws ProxyException {
   try {
     FSPath newPath = file.resolvePath(optNewName);
     if (StringUtil.equals(type, FSPath.FILE_TYPE)) {
       newPath.create();
       return createNewNode(newPath);
     } else if (StringUtil.equals(type, FSPath.FILE_TYPE)) {
       newPath.mkdir();
       return createNewNode(newPath);
     } else {
       throw new ProxyException("Create: unrecognized type:" + type);
     }
   } catch (FileURISyntaxException e) {
     throw new ProxyException("Invalid location:" + optNewName + "\n" + e.getMessage(), e);
   } catch (IOException e) {
     throw new ProxyException(
         "Couldn't create new " + type + " " + optNewName + "\n" + e.getMessage(), e);
   }
 }