Ejemplo n.º 1
0
 public VSphereOutputStream(
     VsphereConnHandler connHandler,
     ManagedObjectReference fileManager,
     ManagedObjectReference vm,
     NamePasswordAuthentication credentials,
     String fileName)
     throws FileNotFoundException, IOException {
   this(
       connHandler,
       fileManager,
       vm,
       credentials,
       File.createTempFile("tmpVixCopy", ".tmp"),
       fileName);
 }
Ejemplo n.º 2
0
 @Override
 public void close() throws IOException {
   if (connHandler == null) {
     return;
   }
   super.close();
   InputStream in = new FileInputStream(tmpFile);
   try {
     copyFileToRemote(fileName, in, this.tmpFile.length(), connHandler, fileManager);
   } finally {
     connHandler.releaseLock();
     connHandler = null;
     in.close();
     tmpFile.delete();
   }
 }