Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8772987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:10:45+00:00 2026-06-13T18:10:45+00:00

I have just written a method for getting a List of differences between two

  • 0

I have just written a method for getting a List of differences between two IFileSpec objects, however, I do not know how to actually retrieve the differences from the IFileDiff object.

Here is the method I have written so far,

public void getFileDiff(String file1, String file2){

        List<IFileSpec> fileList1 = null;
        List<IFileSpec> fileList2 = null;
        List<IFileDiff> fileDiff = null;
        try{

            fileList1 = getIFileSpecList(file1);
            fileList2 = getIFileSpecList(file2);

            fileDiff = iServer.getFileDiffs(fileList1.get(0), fileList2.get(0), null, DiffType.IGNORE_LINE_ENDINGS,false,true,false);

            for(IFileDiff iFileDiff : fileDiff) {

                System.out.println(iFileDiff.getRevision1() + " ::: " + iFileDiff.getRevision2());

            }

        }
        catch(Exception e){e.printStackTrace();}
    }

This code happily prints the correct revisions of the files but getting the actual String differences is something I have yet to come across. If anybody knows what to do I would really like to hear from you !!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:10:46+00:00Added an answer on June 13, 2026 at 6:10 pm

    I forgot to answer this, as far as I remember, there is no way to get the difference of two files using the Perforce Java API. The only way to do it is, Sync out the files to a temporary location and call the OS’s built in “diff” command. Capture the output and pipe to your application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method somewhat similar to the one written bellow(this is just a
I have just written a small piece of code and it struck me that
I have a small I have just written which uses the following uri template.
I have just re-written the authentication for one of our internal web applications to
I've written an XML parser in Python and have just added functionality to read
I have written a small program just like hello the world , everything was
I have written a following code to get just the file name without extension
I have written a SQL query that works just fine, but am having a
I have written a function that positions a tooltip just above a textbox. The
I have written a Perl script, I just want to give it to every

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.