Changeset 27900 in vbox
- Timestamp:
- Mar 31, 2010 2:07:18 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r27895 r27900 420 420 } 421 421 422 /**423 * Public method implementation.424 * @param path425 * @return426 */427 STDMETHODIMP Appliance::Read(IN_BSTR path, IProgress **aProgress)428 {429 if (!path) return E_POINTER;430 CheckComArgOutPointerValid(aProgress);431 432 AutoCaller autoCaller(this);433 if (FAILED(autoCaller.rc())) return autoCaller.rc();434 435 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);436 437 if (!isApplianceIdle())438 return E_ACCESSDENIED;439 440 if (m->pReader)441 {442 delete m->pReader;443 m->pReader = NULL;444 }445 446 // see if we can handle this file; for now we insist it has an ".ovf" extension447 Utf8Str strPath (path);448 if (!strPath.endsWith(".ovf", Utf8Str::CaseInsensitive))449 return setError(VBOX_E_FILE_ERROR,450 tr("Appliance file must have .ovf extension"));451 452 ComObjPtr<Progress> progress;453 HRESULT rc = S_OK;454 try455 {456 /* Parse all necessary info out of the URI */457 parseURI(strPath, m->locInfo);458 rc = readImpl(m->locInfo, progress);459 }460 catch (HRESULT aRC)461 {462 rc = aRC;463 }464 465 if (SUCCEEDED(rc))466 /* Return progress to the caller */467 progress.queryInterfaceTo(aProgress);468 469 return S_OK;470 }471 472 422 STDMETHODIMP Appliance::CreateVFSExplorer(IN_BSTR aURI, IVFSExplorer **aExplorer) 473 423 { -
trunk/src/VBox/Main/ApplianceImplImport.cpp
r27895 r27900 50 50 // 51 51 //////////////////////////////////////////////////////////////////////////////// 52 53 /** 54 * Public method implementation. 55 * @param path 56 * @return 57 */ 58 STDMETHODIMP Appliance::Read(IN_BSTR path, IProgress **aProgress) 59 { 60 if (!path) return E_POINTER; 61 CheckComArgOutPointerValid(aProgress); 62 63 AutoCaller autoCaller(this); 64 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 65 66 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 67 68 if (!isApplianceIdle()) 69 return E_ACCESSDENIED; 70 71 if (m->pReader) 72 { 73 delete m->pReader; 74 m->pReader = NULL; 75 } 76 77 // see if we can handle this file; for now we insist it has an ".ovf" extension 78 Utf8Str strPath (path); 79 if (!strPath.endsWith(".ovf", Utf8Str::CaseInsensitive)) 80 return setError(VBOX_E_FILE_ERROR, 81 tr("Appliance file must have .ovf extension")); 82 83 ComObjPtr<Progress> progress; 84 HRESULT rc = S_OK; 85 try 86 { 87 /* Parse all necessary info out of the URI */ 88 parseURI(strPath, m->locInfo); 89 rc = readImpl(m->locInfo, progress); 90 } 91 catch (HRESULT aRC) 92 { 93 rc = aRC; 94 } 95 96 if (SUCCEEDED(rc)) 97 /* Return progress to the caller */ 98 progress.queryInterfaceTo(aProgress); 99 100 return S_OK; 101 } 52 102 53 103 /**
Note:
See TracChangeset
for help on using the changeset viewer.