Forum Discussion

kaushal_1's avatar
New Contributor
12 years ago

Path of the file uploaded in the server (for static analysis)


I am trying to integrate the static analysis with CodeCollaborator. In sequence of this i have written a trigger which gets executed when a review is created. This trigger will invoke PMD, with intention to do a static analysis of the file (which is uploaded for review). I would like to know if there is a mechanism to figure out the path of the file which got uploaded. 

While checking the internal structure i found that the files got uploaded under "CodeCollaborator Server\tomcat\collaborator-content-cache\...", but with some wage name like "2353b70deb259e6b72f04de0d0a3b476".

Can you please suggest how can we achieve this, is there any API which we can use. 



2 Replies

  • Hi,

    To answer your question, you can find this path using the md5 of the file that you just uploaded. One way to retrieve the md5 from code collaborator is using the review-xml command, with the --xpath //artifact option to just retrieve the uploaded artifacts for the review:

    ccollab admin review-xml <review-id> --xpath //artifact

    You will get an output like this:

    <artifact changelistId="1" changelistScmId="" lines="644" lines-added="11" lines-changed="0" lines-deleted="0" versionId="10">





                    <scm config-a="diffs" config-b="scm-system" id="3" type="none"/>








    Then you can use the md5sum matching the original file path (in <path>) to locate the file in your file system. You will need to use a command line tool in order to find it (such as find in linux, or dir in Windows), as it might be under several subdirectories.

    But, if you really want the file content you can simply use the versionId and call:

    ccollab admin wget /data/server?versionid=<version id>

    In the example above you can do

    ccollab admin wget /data/server?versionid=10

    And that should retrieve the contents of that file.

    These commands are described here:

    Let us know if you have additional questions,

    Luis Luna

    SmartBear Software

    Technical Support

  • kaushal_1's avatar
    New Contributor

    We used the "wget" command to fetch the files (for a particular reviewId "ccollab admin wget /data/server?versionid=<version
    id>"), exactly as suggested by Luis Luna, and it worked for us.

    It seems that we can utilize "wget" for a lot of different things (while working on command line ccollab), so it will be nice if you could improve the documentation ( for this (with more sample usage).

    I appreciate the help.