Usages of

com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Item.getContentLength()
@Override public void updateFrom(final Item item) { Check.isTrue(0 != versionLocal, "Attempted to update a ClientLocalVersionUpdate for an uncommitted item"); //$NON-NLS-1$ encoding = item.getEncoding().getCodePage(); if (VersionControlConstants.ENCODING_FOLDER != encoding) { baselineFileLength = item.getContentLength(); baselineHashValue = item.getContentHashValue(); versionLocalDate = DotNETDate.MIN_CALENDAR.equals(item.getCheckinDate()) ? -1 : DotNETDate.toWindowsFileTimeUTC(item.getCheckinDate()); } }
public void setItem(final Item item) { if (item != null) { itemType = item.getItemType(); itemTypeServerString = item.getItemType().toUIString(); serverItemServer = item.getServerItem(); versionServer = item.getChangeSetID(); deletionID = item.getDeletionID(); /* * TODO Get the server's time zone and convert from it to local * time. */ checkinDateString = FORMATTER.format(item.getCheckinDate().getTime()); if (item.getItemType() == ItemType.FILE && item.getEncoding().equals( new FileEncoding(VersionControlConstants.ENCODING_UNCHANGED)) == false) { encodingString = item.getEncoding().getName(); } fileLength = item.getContentLength(); } }
@Override protected void populate(final PropertyHolder propertyHolder) { final Item item = change.getItem(); propertyHolder.addProperty( Messages.getString("ChangePropertySource.ChangeTypesPropertyName"), //$NON-NLS-1$ Messages.getString("ChangePropertySource.ChangeTypesPropertyDescription"), //$NON-NLS-1$ change.getChangeType().toUIString(true, item)); propertyHolder.addProperty( Messages.getString("ChangePropertySource.ChangesetIdPropertyName"), //$NON-NLS-1$ String.valueOf(item.getChangeSetID())); final Calendar c = item.getCheckinDate(); Object value = (c != null ? dateFormat.format(c.getTime()) : null); propertyHolder.addProperty( Messages.getString("ChangePropertySource.CheckinDatePropertyName"), //$NON-NLS-1$ Messages.getString("ChangePropertySource.CheckinDatePropertyDescription"), //$NON-NLS-1$ value); propertyHolder.addProperty( Messages.getString("ChangePropertySource.DeletionIdPropertyName"), //$NON-NLS-1$ String.valueOf(item.getDeletionID())); propertyHolder.addProperty( Messages.getString("ChangePropertySource.EncodingPropertyName"), //$NON-NLS-1$ String.valueOf(item.getEncoding())); final ItemType itemType = item.getItemType(); value = (itemType != null ? itemType.toString() : null); propertyHolder.addProperty( Messages.getString("ChangePropertySource.ItemTypePropertyName"), //$NON-NLS-1$ Messages.getString("ChangePropertySource.ItemTypePropertyDescription"), //$NON-NLS-1$ value); propertyHolder.addProperty( Messages.getString("ChangePropertySource.ItemIdPropertyName"), //$NON-NLS-1$ String.valueOf(item.getItemID())); propertyHolder.addProperty( Messages.getString("ChangePropertySource.ServerItemPropertyName"), //$NON-NLS-1$ Messages.getString("ChangePropertySource.ServerItemPropertyDescription"), //$NON-NLS-1$ item.getServerItem()); propertyHolder.addProperty(Messages.getString("ChangePropertySource.TimeZonePropertyName"), item.getTimeZone()); //$NON-NLS-1$ propertyHolder.addProperty( Messages.getString("ChangePropertySource.TimeZoneOffsetPropertyName"), //$NON-NLS-1$ item.getTimeZoneO()); final byte[] hash = item.getContentHashValue(); value = (hash != null ? ArrayUtils.byteArrayToHexString(hash) : null); propertyHolder.addProperty(Messages.getString("ChangePropertySource.HashValuePropertyName"), value); //$NON-NLS-1$ propertyHolder.addProperty( Messages.getString("ChangePropertySource.ContentLengthPropertyName"), //$NON-NLS-1$ String.valueOf(item.getContentLength())); propertyHolder.addProperty( Messages.getString("ChangePropertySource.DownloadUrlPropertyName"), //$NON-NLS-1$ item.getDownloadURL()); }
Usage snippet has been bookmarked! Review your bookmarks
Thank you! Review your likes