コード例 #1
0
 public void copyResource(XmldbURI resourcePath, XmldbURI destinationPath, XmldbURI newName)
     throws XMLDBException {
   resourcePath = parent.getPathURI().resolveCollectionPath(resourcePath);
   if (destinationPath == null) destinationPath = resourcePath.removeLastSegment();
   else destinationPath = parent.getPathURI().resolveCollectionPath(destinationPath);
   if (newName == null) {
     newName = resourcePath.lastSegment();
   }
   Vector params = new Vector();
   params.addElement(resourcePath.toString());
   params.addElement(destinationPath.toString());
   params.addElement(newName.toString());
   try {
     client.execute("copyResource", params);
   } catch (XmlRpcException xre) {
     throw new XMLDBException(ErrorCodes.VENDOR_ERROR, xre.getMessage(), xre);
   } catch (IOException ioe) {
     throw new XMLDBException(ErrorCodes.VENDOR_ERROR, ioe.getMessage(), ioe);
   }
 }
コード例 #2
0
 /* (non-Javadoc)
  * @see org.xmldb.api.base.Resource#getId()
  */
 public String getId() throws XMLDBException {
   return path.lastSegment().toString();
 }