use of com.vmware.vim25.GuestOperationsFaultFaultMsg in project mucommander by mucommander.
the class VSphereFile method changeDate.
@Override
public void changeDate(long lastModified) throws IOException, UnsupportedFileOperationException {
VsphereConnHandler connHandler = null;
try {
GuestFileAttributes gfa = new GuestFileAttributes();
gfa.setModificationTime(getTimeToXmlTime(lastModified));
connHandler = getConnHandler();
connHandler.getClient().getVimPort().changeFileAttributesInGuest(getFileManager(connHandler), vm, credentials, getPathInVm(), gfa);
} catch (FileFaultFaultMsg e) {
translateandLogException(e);
} catch (GuestOperationsFaultFaultMsg e) {
translateandLogException(e);
} catch (InvalidStateFaultMsg e) {
translateandLogException(e);
} catch (RuntimeFaultFaultMsg e) {
translateandLogException(e);
} catch (TaskInProgressFaultMsg e) {
translateandLogException(e);
} catch (InvalidPropertyFaultMsg e) {
translateandLogException(e);
} catch (DatatypeConfigurationException e) {
translateandLogException(e);
} finally {
releaseConnHandler(connHandler);
}
}
use of com.vmware.vim25.GuestOperationsFaultFaultMsg in project mucommander by mucommander.
the class VSphereFile method checkAttributues.
private void checkAttributues(VsphereConnHandler connHandler) throws IOException, FileFaultFaultMsg, GuestOperationsFaultFaultMsg, InvalidStateFaultMsg, RuntimeFaultFaultMsg, TaskInProgressFaultMsg, InvalidPropertyFaultMsg {
ManagedObjectReference fileManager = getFileManager(connHandler);
GuestListFileInfo res = null;
try {
res = connHandler.getClient().getVimPort().listFilesInGuest(fileManager, vm, credentials, getPathInVm(), null, null, null);
} catch (SOAPFaultException e) {
if (isFileNotFound(e)) {
return;
}
throw e;
}
if (res.getFiles().size() == 1) {
// only one result - it's a file
GuestFileInfo guestFileInfo = res.getFiles().get(0);
updateAttributes(guestFileInfo);
} else {
// find the entry for "."
for (GuestFileInfo f : res.getFiles()) {
if (f.getPath().equals(".")) {
updateAttributes(f);
break;
}
}
}
}
use of com.vmware.vim25.GuestOperationsFaultFaultMsg in project mucommander by mucommander.
the class VSphereFile method delete.
@Override
public void delete() throws IOException, UnsupportedFileOperationException {
VsphereConnHandler connHandler = null;
try {
connHandler = getConnHandler();
ManagedObjectReference fileManager = getFileManager(connHandler);
if (isDirectory()) {
connHandler.getClient().getVimPort().deleteDirectoryInGuest(fileManager, vm, credentials, getPathInVm(), false);
isDir = false;
} else {
connHandler.getClient().getVimPort().deleteFileInGuest(fileManager, vm, credentials, getPathInVm());
isFile = isSymLink = false;
}
} catch (FileFaultFaultMsg e) {
translateandLogException(e);
} catch (GuestOperationsFaultFaultMsg e) {
translateandLogException(e);
} catch (InvalidStateFaultMsg e) {
translateandLogException(e);
} catch (RuntimeFaultFaultMsg e) {
translateandLogException(e);
} catch (TaskInProgressFaultMsg e) {
translateandLogException(e);
} catch (InvalidPropertyFaultMsg e) {
translateandLogException(e);
} finally {
releaseConnHandler(connHandler);
}
}
Aggregations