[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tm-cvs-commit] dmcknight org.eclipse.tm.rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/files LocalFileService.java

Update of /cvsroot/tools/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/files
In directory dev2:/tmp/cvs-serv15539/src/org/eclipse/rse/internal/services/local/files

Modified Files:
	LocalFileService.java 
Log Message:
[337612] Failed to copy the content of a tar file

Index: LocalFileService.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/files/LocalFileService.java,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** LocalFileService.java	27 Jan 2011 02:20:18 -0000	1.58
--- LocalFileService.java	24 Feb 2011 16:56:12 -0000	1.59
***************
*** 1,4 ****
  /*******************************************************************************
!  * Copyright (c) 2006, 2010 IBM Corporation and others.
   * All rights reserved. This program and the accompanying materials
   * are made available under the terms of the Eclipse Public License v1.0
--- 1,4 ----
  /*******************************************************************************
!  * Copyright (c) 2006, 2011 IBM Corporation and others.
   * All rights reserved. This program and the accompanying materials
   * are made available under the terms of the Eclipse Public License v1.0
***************
*** 50,53 ****
--- 50,54 ----
   * David McKnight   (IBM)        - [331247] Local file paste failed on Vista and Windows 7
   * Xuan Chen        (IBM)        - [222544] [testing] FileServiceArchiveTest leaves temporary files and folders behind in TEMP dir
+  * David McKnight   (IBM)        - [337612] Failed to copy the content of a tar file
   *******************************************************************************/
  
***************
*** 1398,1401 ****
--- 1399,1411 ----
  	}
  
+ 	private boolean isTempFile(File resource){
+ 		String workspaceLocation = System.getProperty("osgi.instance.area");
+ 		if (workspaceLocation != null && workspaceLocation.length() > 0){
+ 			workspaceLocation = workspaceLocation.substring(6).replace('/', File.separatorChar);
+ 		}
+ 		String path = resource.getAbsolutePath();
+ 		return (path.startsWith(workspaceLocation));
+ 	}
+ 	
  	/**
  	 * Copy a file or folder to a new target parent folder, but if
***************
*** 1426,1430 ****
  			checkArchiveOperationStatusThread = new CheckArchiveOperationStatusThread(archiveOperationMonitor, monitor);
  		}
! 		if (!(ArchiveHandlerManager.isVirtual(targetFolder.getAbsolutePath())) && !ArchiveHandlerManager.getInstance().isArchive(targetFolder))
  		{
  			// this is an optimization to speed up extractions from large zips. Instead of
--- 1436,1442 ----
  			checkArchiveOperationStatusThread = new CheckArchiveOperationStatusThread(archiveOperationMonitor, monitor);
  		}
! 		boolean isTempFile = isTempFile(targetFolder);
! 		
! 		if (!(ArchiveHandlerManager.isVirtual(targetFolder.getAbsolutePath()) && !isTempFile) && !ArchiveHandlerManager.getInstance().isArchive(targetFolder))
  		{
  			// this is an optimization to speed up extractions from large zips. Instead of
***************
*** 1512,1516 ****
  			src = tempSource.getAbsolutePath() + File.separatorChar + child.name;
  		}
! 		if (ArchiveHandlerManager.isVirtual(targetFolder.getAbsolutePath()) || ArchiveHandlerManager.getInstance().isArchive(targetFolder))
  		{
  			File source = new File(src);
--- 1524,1528 ----
  			src = tempSource.getAbsolutePath() + File.separatorChar + child.name;
  		}
! 		if ((ArchiveHandlerManager.isVirtual(targetFolder.getAbsolutePath()) && !isTempFile) || ArchiveHandlerManager.getInstance().isArchive(targetFolder))
  		{
  			File source = new File(src);