Usages of

com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Item.getServerItem()
public DiffItem( final Item item, final String localPath, final String tempFile, final DiffItem rootItem, final VersionSpec version) { this( item.getServerItem(), localPath, tempFile, item.getEncoding().getCodePage(), rootItem, item.getItemType(), item.getCheckinDate().getTimeInMillis(), true, version); Check.notNull(item, "item"); //$NON-NLS-1$ this.item = item; changesetVersion = item.getChangeSetID(); }
@Override protected void doRun(final TFSRepository repository) { final Changeset changeset = (Changeset) getSelectionFirstElement(); final Item item = changeset.getChanges()[0].getItem(); final String localFileName = ServerPath.getFileName(item.getServerItem()); final String localItem = item.downloadFileToTempLocation(repository.getVersionControlClient(), localFileName).getAbsolutePath(); ViewFileHelper.viewLocalFileOrFolder(localItem, site.getPage(), false); }
@Override public void onDestroy(final DestroyEvent event) { final Item destroyedItem = event.getDestroyedItem(); String itemString = destroyedItem.getServerItem(); if (destroyedItem.getDeletionID() != 0) { itemString += ";X" + destroyedItem.getDeletionID(); //$NON-NLS-1$ } getDisplay().printLine(MessageFormat.format(Messages.getString("Command.DestroyedFormat"), itemString)); //$NON-NLS-1$ }
@Override protected void doRun(final TFSRepository repository) { final Change change = (Change) adaptSelectionFirstElement(Change.class); final Item item = change.getItem(); final Compare compare = new Compare(); compare.setModified(new TFSItemNode(item, repository.getVersionControlClient())); compare.setOriginal( new ServerItemByItemVersionGenerator( repository, new ItemSpec(item.getServerItem(), RecursionType.NONE, item.getDeletionID()), new ChangesetVersionSpec(item.getChangeSetID()), new ChangesetVersionSpec(item.getChangeSetID() - 1))); compare.addComparator(TFSItemContentComparator.INSTANCE); compare.setUIType(compareUIType); compare.setExternalCompareHandler(new UserPreferenceExternalCompareHandler(shell)); compare.open(); }
@Override protected void doRun(final TFSRepository repository) { final Change change = (Change) adaptSelectionFirstElement(Change.class); final Item item = change.getItem(); final Compare compare = new Compare(); compare.setModified(new TFSItemNode(item, repository.getVersionControlClient())); compare.setOriginal( new ServerItemByItemVersionGenerator( repository, new ItemSpec(item.getServerItem(), RecursionType.NONE, item.getDeletionID()), new ChangesetVersionSpec(item.getChangeSetID()), LatestVersionSpec.INSTANCE)); compare.addComparator(TFSItemContentComparator.INSTANCE); compare.setUIType(compareUIType); compare.setExternalCompareHandler(new UserPreferenceExternalCompareHandler(shell)); compare.open(); }
/* * (non-Javadoc) * * @see * com.microsoft.tfs.client.clc.vc.diff.launch.DiffLaunchItem#getFilePath() */ @Override public String getFilePath() throws CLCException { if (filePath == null) { // Make sure we have an item. final Item item = getItem(); Check.notNull(item, "item"); //$NON-NLS-1$ filePath = getVersionedTempFileFullPath(item.getServerItem(), item.getItemType(), version); item.downloadFile(client, filePath); } return filePath; }
public TFSItemNode(final Item item, final VersionControlClient vcClient) { // code omitted ... @Override public String toString() { return item.getServerItem() + ";C" + item.getChangeSetID(); //$NON-NLS-1$ }
private String formatDirectoryItem(final Item item) { final StringBuffer sb = new StringBuffer(); /* * This looks dumb to me, but Microsoft's client puts a $ (not "$/") * before each folder item, instead of something like "/" after it. */ if (item.getItemType() == ItemType.FOLDER) { sb.append(ServerPath.ROOT_NAME_ONLY); } final String itemName = VersionedFileSpec.formatPathWithDeletionIfNecessary( ServerPath.getFileName(item.getServerItem()), item.getDeletionID()); sb.append(itemName); return sb.toString(); }
private String getLocalItemToView(final Change change, final TFSRepository repository) { Item item = change.getItem(); if (ViewVersionType.PREVIOUS == viewVersionType || ViewVersionType.LATEST == viewVersionType) { int version; if (ViewVersionType.PREVIOUS == viewVersionType) { version = item.getChangeSetID() - 1; } else { // Latest version = Integer.MAX_VALUE; } item = repository.getVersionControlClient().getItem(item.getItemID(), version, true); } final String localFileName = ServerPath.getFileName(item.getServerItem()); return item.downloadFileToTempLocation(repository.getVersionControlClient(), localFileName).getAbsolutePath(); }
/* (non-Javadoc) * @see com.rabit.scm.SCM#getRepositoryFilesList(org.tmatesoft.svn.core.io.SVNRepository, java.lang.String, java.util.HashMap) */ @Override public HashMap<String, String> getRepositoryFilesList(SCMOptions options, HashMap<String, String> filesMap) { TFSTeamProjectCollection tpc = connectToTFS(); VersionControlClient vcc = tpc.getVersionControlClient(); ItemSet itemSet = vcc.getItems(options.getBranchName(), LatestVersionSpec.INSTANCE, RecursionType.FULL); Item[] items = itemSet.getItems(); String filepath = ""; for (Item item : items) { filepath = item.getServerItem(); if(filepath.startsWith(options.getBranchName())){ filepath = filepath.substring(options.getBranchName().length() + 1); } filesMap.put(filepath, DateUtil.getUTCDate(item.getCheckinDate().getTime().toLocaleString())); } return filesMap; }
Usage snippet has been bookmarked! Review your bookmarks
Thank you! Review your likes