mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-03 14:25:37 +02:00
[337612] Failed to copy the content of a tar file
This commit is contained in:
parent
781f40219e
commit
bac970f24b
1 changed files with 10 additions and 6 deletions
|
@ -69,12 +69,15 @@ import java.io.InputStreamReader;
|
|||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.osgi.service.datalocation.Location;
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
import org.eclipse.rse.internal.services.local.Activator;
|
||||
import org.eclipse.rse.internal.services.local.ILocalMessageIds;
|
||||
|
@ -1399,12 +1402,13 @@ public class LocalFileService extends AbstractFileService implements ILocalServi
|
|||
}
|
||||
|
||||
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));
|
||||
Location instanceLoc = Platform.getInstanceLocation();
|
||||
URL workspaceLocation = instanceLoc.getURL(); // currently, Eclipse doesn't escape URLs
|
||||
|
||||
String wsLocation = new File(workspaceLocation.getPath()).toURI().toString();
|
||||
String fileLocation = resource.toURI().toString();
|
||||
|
||||
return fileLocation.startsWith(wsLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue