Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to fetch the history a versioned file in rtc programmatically

Hi,
I am able to locate the file programmatically in rtc. But i need to check whether the file has history or not. Please let me know.

public static IVersionableHandle findFile(IFolderHandle root,

    IConfiguration iconfig, String fileName, IProgressMonitor monitor)

    throws TeamRepositoryException {

        System.out.println(fileName+ "---File Name---");
        String fileNamePath[] = { fileName };

        IVersionableHandle filePathHandle = null;

        // Check if file at this folder level

        filePathHandle = iconfig.resolvePath(root, fileNamePath, monitor);

        if (filePathHandle != null) {

            return filePathHandle;

        }

        @SuppressWarnings("unchecked")
        Map<String, IVersionableHandle> childEntries = iconfig.childEntries(root, monitor);

        for (Map.Entry<String, IVersionableHandle> next : childEntries.entrySet()) {

            IVersionableHandle nextVersionable = next.getValue();

            if (nextVersionable instanceof IFolderHandle) {

                filePathHandle = findFile((IFolderHandle) nextVersionable,iconfig, fileName, monitor);

                if (filePathHandle != null) {

                    System.out.println("Found file " + fileName);

                    break;

                }

            }

        }
        return filePathHandle;
    }

0 votes


Be the first one to answer this question!

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 7,495
× 1,220

Question asked: Sep 03 '15, 1:40 a.m.

Question was seen: 2,828 times

Last updated: Sep 03 '15, 1:40 a.m.

Confirmation Cancel Confirm