コード例 #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);
 }
コード例 #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();
   }
 }