/**
* @param r
*/
private void discardDownloadResource(IResource r) {
try {
HDFSFileStore store = (HDFSFileStore) EFS.getStore(r.getLocationURI());
switch (r.getType()) {
case IResource.FOLDER:
IFolder folder = (IFolder) r;
IResource[] members = folder.members();
if (members != null) {
for (int mc = 0; mc < members.length; mc++) {
discardDownloadResource(members[mc]);
}
}
case IResource.FILE:
if (store.isLocalFile()) {
File file = store.getLocalFile();
HDFSManager.INSTANCE.startServerOperation(store.toURI().toString());
try{
if (file.exists()) {
file.delete();
UploadFileJob.deleteFoldersIfEmpty(file.getParentFile());
}
r.getParent().refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor());
}finally{
HDFSManager.INSTANCE.stopServerOperation(store.toURI().toString());
}
}
}
} catch (CoreException e) {
MessageDialog.openError(targetPart.getSite().getShell(), "Upload HDFS Resources", "Error uploading resource to " + r.getLocationURI() + ": "