Java 类com.vmware.vim25.OvfFileItem 实例源码

项目:photon-model    文件:OvfDeployer.java   
private long getImportSizeBytes(OvfCreateImportSpecResult importResult) {
    List<OvfFileItem> items = importResult.getFileItem();
    if (items == null) {
        return 0;
    }

    long totalBytes = 0;
    for (OvfFileItem fi : items) {
        totalBytes += fi.getSize();
    }

    return totalBytes;
}
项目:photon-model    文件:OvfDeployer.java   
protected String computeDiskSourceUri(String basePath, OvfFileItem ovfFileItem) {
    String s = ovfFileItem.getPath();
    if (s.startsWith("https://") ||
            s.startsWith("http://") ||
            s.startsWith("file://")) {
        return s;
    }

    return basePath + s;
}
项目:cs-actions    文件:DeployOvfTemplateService.java   
private void transferVmdkFiles(final String ovfPath, final OvfCreateImportSpecResult importSpecResult,
                               final List<HttpNfcLeaseDeviceUrl> deviceUrls, final ProgressUpdater progressUpdater)
        throws Exception {
    for (HttpNfcLeaseDeviceUrl deviceUrl : deviceUrls) {
        final String deviceKey = deviceUrl.getImportKey();
        for (OvfFileItem fileItem : importSpecResult.getFileItem()) {
            if (deviceKey.equals(fileItem.getDeviceId())) {
                final TransferVmdkTask transferVmdkTask = getTransferVmdkTask(ovfPath, progressUpdater, deviceUrl, fileItem);
                executor.execute(transferVmdkTask);
                break;
            }
        }
    }
}
项目:cs-actions    文件:DeployOvfTemplateService.java   
@NotNull
private TransferVmdkTask getTransferVmdkTask(final String ovfPath, final ProgressUpdater progressUpdater,
                                             final HttpNfcLeaseDeviceUrl deviceUrl, final OvfFileItem fileItem)
        throws Exception {
    final URL vmDiskUrl = new URL(deviceUrl.getUrl());
    final ITransferVmdkFrom transferVmdkFrom = getTransferVmdK(ovfPath, fileItem.getPath());
    final TransferVmdkToUrl toUrl = new TransferVmdkToUrl(vmDiskUrl, fileItem.isCreate());

    return new TransferVmdkTask(transferVmdkFrom, toUrl, progressUpdater);
}
项目:cs-actions    文件:DeployOvfTemplateService.java   
private long getDisksTotalNoBytes(final OvfCreateImportSpecResult importSpecResult) {
    long disksTotalNoBytes = 0;
    for (final OvfFileItem item : importSpecResult.getFileItem()) {
        if (item.getCimType() == DISK_DRIVE_CIM_TYPE) {
            disksTotalNoBytes += item.getSize();
        }
    }
    return disksTotalNoBytes;
}
项目:cloudstack    文件:HttpNfcLeaseMO.java   
public static long calcTotalBytes(OvfCreateImportSpecResult ovfImportResult) {
    List<OvfFileItem> fileItemArr = ovfImportResult.getFileItem();
    long totalBytes = 0;
    if (fileItemArr != null) {
        for (OvfFileItem fi : fileItemArr) {
            totalBytes += fi.getSize();
        }
    }
    return totalBytes;
}