Comparing the creation time of two jars.

Hi,
My requirement is that i need to compare the creation time of two of the jars and see which one of the jar is the latest.
I did it using the following code i get the output in the form of strings so i cant compare them to find which one is the latest.
import java.io.*;
import java.util.*;
public class FileTest {
     public static void main(String args[]) {
          File devbuild = new File(
                    "\\\\devspace\\dev$\\ReleaseEng\\DEVbuilds\\tw_enterprise\\build\\jboss\\Oracle\\Twelibrary.jar");
          File local = new File(
                    "D:\\jboss-4.2.1.GA\\server\\TWEServer\\Twelibrary.jar");
          Calendar now = Calendar.getInstance();
          int currtime = now.get(Calendar.HOUR_OF_DAY);
          int maxtime = 18;
          System.out.println("Before the while loop");
          while (currtime < maxtime) {
               System.out.println("Inside the while loop");
               if (devbuild.exists()) {
                    try {
                         // get runtime environment and execute child process
                         Runtime systemShell = Runtime.getRuntime();
                         BufferedReader br1 = new BufferedReader(
                                   new InputStreamReader(new FileInputStream(devbuild)));
                         BufferedReader br2 = new BufferedReader(
                                   new InputStreamReader(new FileInputStream(local)));
                         Process output = systemShell.exec("cmd /c dir " + devbuild);
                         Process output1 = systemShell.exec("cmd /c dir " + local);
                         // open reader to get output from process
                         BufferedReader br = new BufferedReader(
                                   new InputStreamReader(output.getInputStream()));
                         BufferedReader br3 = new BufferedReader(
                                   new InputStreamReader(output1.getInputStream()));
                         String out = "";
                         String out1 = "";
                         String line = null;
                         String line1 = null;
                         int step = 1;
                         int step1 = 2;
                         while ((line = br.readLine()) != null) {
                              if (step == 6) {
                                   out = line;
                              step++;
                         } // display process output
                         while ((line1 = br3.readLine()) != null) {
                              if (step1 == 6) {
                                   out1 = line1;
                              step1++;
                         try {
                              out = out.replaceAll(" ", "");
                              out1 = out1.replaceAll(" ", "");
                              System.out.println("CreationDate: "
                                        + out.substring(0, 10));
                              System.out.println("CreationTime: "
                                        + out.substring(10, 16) + "m");
                              System.out.println("CreationDate: "
                                        + out1.substring(0, 10));
                              System.out.println("CreationTime: "
                                        + out1.substring(10, 16) + "m");
                         } catch (StringIndexOutOfBoundsException se) {
                              System.out.println("File not found");
                         //Long modifiedtime = devbuild.lastModified();
                         //long oldtime = old.lastModified();
                         int devbuilddate = Integer.parseInt(out.substring(0, 10));
                         int devbuildtime = Integer.parseInt(out.substring(10, 16));
                         int localbuilddate = Integer.parseInt(out1.substring(0, 10));
                         int localbuildtime = Integer.parseInt(out1.substring(10, 16));
                         if (devbuilddate >= localbuilddate && devbuildtime >= localbuildtime) {
                              System.out.println("The Build date is Later than the one i am having--->");
                              System.exit(6);
                         } else {
                              System.exit(0);
                    } catch (Exception e) {
                         e.printStackTrace();
               if (currtime > maxtime) {
                    System.exit(5);
How can i do it?
Can anyone help me out in this.
Thanks,
Kavipriya.

Hi Clap,
Thanks for ur reply. Let me say you the scenario clearly. We are in the process of automating some of the process. We have builds running daily night and our automation will run using that build.
Currently the build which is getting generated does have manifest in it. For our automation framework we cant suggest adding the manifest. Which will not be agreed.
Our automation will be checking till 10.am. to check whether the build is ready if not it will come out of the loop. If the build is avaialble within 10 then it will take the build and see whetehr the creation date and time of the build and the one i am having locally or different. If diff it will see whether the build generated is latest than the one i am having.
If it so then the process will run.
So hope you got my issue.

Similar Messages

  • Use more than one transition in the same time between two video clips?

    Dear Premiere Pro programmers,
    Could you please create a way to use more than one transition in the same time between two video clips without exporting to media, or creating new sequence, or using another layer (adjustment or transparent)?
    Message was edited by: Kevin Monahan
    Reason: Next time, create a more descriptive title.

    Hi Aqsa Nori,
    I'm not sure what you are imagining, but it might be possible to achieve by key framing effects. Can you tell us what you want to do? Also, please feel free to file a feature request: http://adobe.ly/feature_request
    Thanks,
    Kevin

  • HT4528 For the second time in two weeks, my 4s has lost all my contact names. The phone numbers are still there, but every last name has disapeared. What is happening?

    For the second time in two weeks, my Iphone 4s has lost all my contact names. The phone numbers still remain without any of the names, What is causing this to happen?

    1.  I assume that that suggests that it is not normal for a browser window to respond with minimisation?  It is just weird when a window just disappears, no reason given (and since there is no obvious loss of internet it can take you by chance)
    2.  Good that you ask.  No, it hasn't.  I meant to say when I first posted.
    3.  Thanks, I gather that.  It is just that Mavericks is so different from what I am used to.  Sigh...
    4.  It has calmed down but there is absolutely no rhyme or reason to it.  Forgot to mention that I had my first ever crash of Final Cut Pro since I have been using it nearly daily for four years.  I even had Chrome crash on me in mid-upload (drat, drat, drat!).  I don't click or plough on- I stop, think and consider. Hence me posting.  Mavericks is just not as "smooth" as Snow Leopard to me.
    5.  Yes, I understand.  I just wish it would show me both instead of just the one with the "1". 
    Tell me about it!  It is impossible, I came here to answer via the link in the emailed notification, was already signed out and signed in and was returned to the front page.  Had to go back to my Mail, click the link again and this time, luckily, I was signed in.  In other words- the session is impossibly short and signing in doesn't return you to the browser window you were but rather returns you to the front.  Meh.

  • How can I log into two differant accounts at the same time in two windows without the second window affecting the first.

    I'm trying to log into two facebook accounts at the same time in differant windows. When ever I log into the second account in the second window it changes the login in the first window. When I hit home or any other link the first window account has been logged out and logged into the second window account. I tried installing a second copy of firefox in a differant folder that the first but it seems to use all the files of the first installation. If I can get 2 toatally seperated instalations that don't rely on the same history, cookies, cache, etc I belive that will solve my problem. Please help.
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)

    Nah, that won't work. Facebook has a feature that gets your IP Address, so as soon as you sign into one on the same computer, it changes the other login for safety purposes (say, someone was on a public library PC. They forgot to log out. Someone else logs in, and it automatically logs them out). You'll need 2 computers to do that.

  • Comparing the "line" results of two Cubesets- is it possible?

    Hi all-
    I had asked this previously- I'm going to try again and hopefully be clearer about what I'm hoping to accomplish. I'm open to any way to accomplish this, although in the best possible world I'd be able to keep it inside one or more cubeformulas using MDX
    as needed.
    Using Cubeset, I can grab a slice of an AS cube. For this example I'll use [locations] and [Jan 2014]. The resulting cubeset has 3 items: 
    Rock City
    Orlando
    Boston
    Now I want to compare two measures for equality (by location), without building a pivot table or creating a cell for each of the returned locations (some cubesets will be quite large).
    For example, it is important that [Hours worked] and [Hours paid] are
    equal. I don't want to know if the overall sums are equal, I need to know if they are equal for each item in the Cubeset;
                      Worked      Paid
    Rock City       220          220
    Orlando          517          516
    Boston           391          392
    Total           1128        1128
    So in this example, the grand total is the same, but my comparison should return a False/failed result because one location paid more than they should have, and someone at the other location got underpaid.
    What is the best way to compare measures at a "line item" (cubeset) level without powerpivot or pivot tables? I'd even take a VBA solution over a pivot table- I'm good with VBA, although it would still be another learning curve for me
    to learn how to access the AS cube more directly and make these comparisons in VBA.
    One additional complication- for some measures, I will need to round (or roundup) the individual values before comparison. If a person works 8.97 hours, we are going to pay them for 9. For other measures it will be a normal rounding to zero decimals, to
    smooth out calculation differences.
    If I can get the individual line item comparison but not the rounding, I'll ask the cube folks to add rounded measures to the cube for me, so that is my backup plan if it is possible to do the comparison but not the rounding.
    I appreciate any/all suggestions on how to do this comparison, starting from the existing cubesets!

    Hi Keith,
    As I understand you are trying to add compare the values.
    I am trying to look into it but as of now I have this workaround for you. You can try to create a new column having if formula that returns 1 if the cell values are equal and 0 if they are not.
    At the total row we compare the sum of value of the column with if formula that we created and the sum 1128 in this case with the help of if formula again.
     The formula that returned wrongvalue is IF(B5=SUM(D2:D4),B5,"wrong values"). Please let me know if it works for you. Below is the table that I worked on -
    Worked     
    Paid
        Compare
    Rock City
    220
    220

    Orlando         
    517
    516
    0
    Boston          
    391
    392
    0
    Total          
    1128       
    1128
        wrongvalue

  • How to compare the codes written in two different windows?

    Hi ,
    I have a long code written for a FM.
    Now I have got the same code in a notepad.
    I want to check weather the codes in the two windows are exactly alike.
    Is there any easy way to do this?

    hi Harshit Rungta ,
    T-code SE39 - ABAP split screen editor use to compare 2 different programs ,function modules ,class
    just create a function module that available in notepad and compare the code which u have already .
    choose the function radio button while checking the function module .
    regards
    chinnaiya

  • Comparing the roles b/w two systems

    hi
    to all
    i want to know is it possible to compare the roles between two system i.e., source system (old version system)and target system(new version system).

    Hi,
    Hi,
    These tcodes are mainly used to compare the authorisations objects assigned to two different users/roles/profiles etc in same or diff systems.
    To compare between two
    Tcodes
    Users----
    S_BCE_68001430
    Roles----
    S_BCE_68001777
    Profiles----
    S_BCE_68001431
    Authorizations----
    S_BCE_68001432
    Hope this helps.
    Pl award suitable points.
    Regards

  • Can I use Adobe Creative Cload at the same time on two computers and is this legal ?

    Look at the title

    Cloud License allows 2 activations http://www.adobe.com/legal/licenses-terms.html
    -Install on a 2nd computer http://forums.adobe.com/thread/1452292?tstart=0
    -Windows or Mac does not matter... 2 on the same operating system, or 1 on each
    -Both subscriptions MAY be in use at the same time https://forums.adobe.com/thread/1683787

  • Two different songs played at the same time in two rooms ?

    Can i play one song on my computer and another in a different room at the same time using Airport Express or any other way?

    No. The same music plays on the computer and AirPort Express (AX).

  • TS4002 I receive text messages at the same time on two different phones! How can I remove from settings ?

    I receive text message on both phones at the same time! How can I avoid this from happening? I have limited text message plan on one phone and this will add up fast .

    Are these iMessages or SMS? You are not charged for iMessages (they will appear in blue).
    Go to Settings > Messages > Receive At to remove an unwanted number.

  • How to compare the query definiation of two or more queries?

    HI Folks.
    I am attempting to determine if there is a method by which I can compare query definination of two or more queries or shows me the differences between queries. 
    Transaction RSRTQ only give the query details of single query at a time and doesnot do a comparison.
    Please let me know a method to undertake this?
    Thanks
    Uday

    There is no straight way of doing this:
    I normally open the definitions in 2 sessions and compare them manually.
    Hope this helps

  • Using Mavericks for the first time, day two- heeeelp!

    OK, long story short:  old MacBook Pro with Snow Leopard went to Apple Heaven and new MacBook Pro with Mavericks (also is a 15" 2.3GHz i7 512GB flash drive machine with 16GB RAM) got a "data transplant" via Migration Assistant or whatever it is called.
    The new MacBook Pro essentially took all the data and all my settings/preferences as well as my crucial software which is disk-loaded (I bought an external drive, arrived today), rejecting only what was incompatible (unfortunately my Oldie But Goodie Photoshop).
    So far, so good.
    Now-  learning curve aside- there is weird behaviour going on:
    1.  The (Chrome) browser screens disappear if internet connection is lost but this is not shown in the wifi so I am never sure if it is loss of Broadband or loss of wifi.  I personally blame BT for this because, after 22 weeks of rubbish service, I know that the connection is less than ideal.  Is this normal behaviour?  Then-
    2.  there was a weird buzz like alarm noise, quite loud from near the palm rest on the left which nearly gave me a heart attack (I am now exceedingly stressed over the matter of breakdown, repair, and another breakdown of my main machine which I had to pay for and then anyway replace).  Should I be worried?
    3.  Final Cut Pro's Compressor is failing on export (I have posted on that forum, after trying the cleaning up of settings and trashing preferences).  Does anyone know how best to uninstall software on Mavericks without completely making a guddle of it?  So that I can reinstall, from the disks and see if I can cure the problem, or is that not even recommended/necessary?
    4.  Clicking a link in Mail will open TWO browser instances since I agreed to the incessant prompts to update software (yes, it restarted).  I hope that this is a passing phase because it is like it is launching as many windows as clicks for an apparently unresponsive link...?  Does that make sense?  And-
    5.  My user folder has a "1" after it, probably because it is a duplicate of the one from the old Mac?  Can I get rid of that "1" or am I stuck with it?  I wish I had been able to just bring in the applications, my Mail, my iPhoto and some utilities I value.  But the option to migrate is very all (with just three or four option) or nothing.
    Finally-  signing into the forum after viewing as a guest doesn't work first time.  I end up having to press "sign in" a few times to see my name pop up.  And even then I still cannot go into some threads without me being "signed out" again.
    Folks-  thank you for reading.  I love Snow Leopard, never thought that I would end up with having to use Mavericks with ZERO time to adapt (as is Sod's Law-  I have a client with a deadline who has already been waiting three weeks due to the demise of my main Mac) and ANY help coping is immensely appreciated.

    1.  I assume that that suggests that it is not normal for a browser window to respond with minimisation?  It is just weird when a window just disappears, no reason given (and since there is no obvious loss of internet it can take you by chance)
    2.  Good that you ask.  No, it hasn't.  I meant to say when I first posted.
    3.  Thanks, I gather that.  It is just that Mavericks is so different from what I am used to.  Sigh...
    4.  It has calmed down but there is absolutely no rhyme or reason to it.  Forgot to mention that I had my first ever crash of Final Cut Pro since I have been using it nearly daily for four years.  I even had Chrome crash on me in mid-upload (drat, drat, drat!).  I don't click or plough on- I stop, think and consider. Hence me posting.  Mavericks is just not as "smooth" as Snow Leopard to me.
    5.  Yes, I understand.  I just wish it would show me both instead of just the one with the "1". 
    Tell me about it!  It is impossible, I came here to answer via the link in the emailed notification, was already signed out and signed in and was returned to the front page.  Had to go back to my Mail, click the link again and this time, luckily, I was signed in.  In other words- the session is impossibly short and signing in doesn't return you to the browser window you were but rather returns you to the front.  Meh.

  • Index creation a long time..Please help to tune the creation time.

    Hi all,
    I am creating a index after using impdp to put the data in that table.
    Below is my index creation command.The index creation takes ~30 minutes .
    Can the forum memebers suggest me how to put this index creation with parallel clause or otherwise to reduce the time it takes to create the index?
    +++++++++++++++++++++++++++++++++++++++++++++++
    spool incre_HUNTER_PK_1.log
    set lines 200 pages 0 echo on feedback on timing on time on
    alter session enable parallel dml;
    alter session enable parallel ddl;
    CREATE UNIQUE INDEX "HUNTER_PK" ON "HUNTER" ("HUNTER_NUM", "BILL_SEQ", "BILL_VERSION")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 NOLOGGING COMPUTE STATISTICS
    STORAGE(INITIAL 4294967296 NEXT 16777216 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "HUNTER_LARGE_02";
    ALTER TABLE HUNTER ADD PRIMARY KEY ("HUNTER_NUM", "BILL_SEQ", "BILL_VERSION") USING INDEX HUNTER_PK;
    ALTER INDEX "HUNTER_PK" NOLOGGING NOPARALLEL;
    spool off
    +++++++++++++++++++++++++++++++++++++++++++++++
    Some other details:
    1. My imdp command import nearly the below details
    . . imported "HUSTY"."HUNTER" 42.48 GB 218185783 rows
    2. It is a non-partitioned table.
    3. I cant drop the table at the target.
    Regds,
    Kunwar

    Kunwar wrote:
    Can the forum memebers suggest me how to put this index creation with parallel clause or otherwise to reduce the time it takes to create the index?
    What version of the database?
    Creating indexes in parallel is described in the documentation. Search the on-line documentation for the syntax for create index; if there aren't any specific examples of creating indexes in parallel do a Google search for "create index parallel"

  • How to compare the *.so files of two different directories?

    Good morning,
    I am working in a software development company that works as follows:
    - we have a platform, that consists of a list of *.so files.
    - we deliver a product, based on that platform, that also consists of a list of *.so files.
    - all our sources are managed via Clearcase.
    Now I have the following situation:
    - we have created a new Clearcase view, where we (should have) all correct sources. These have been compiled, resulting in a list of *.so files.
    - we have a copy of the product that we have delivered at the client.
    I would like to verify whether the *.so files of the new Clearcase view are the same as the ones that have been delivered to the client.
    Why is this such a problem?
    - I could check the "cksum" result, but as the Solaris command "cksum" takes into account the compilation date, I have different "cksum" results for *.so files that are basically equal.
    - I could check the filesize, but a small change in a source might change the behaviour of the *.so file but not necessarily its filesize.
    - I could check the "what" result (the "C Compilation System" "what" command), which gives the Clearcase status, so that I can check whether the same Clearcase versions have been delivered, but while doing this, I have seen that *.so files have been delivered, the sources of which were checked OUT (!), so also this does not give me any certainty.
    - In addition, it is possible that there is a change in the platform components, resulting in a different product specific *.so file, which however does not mean that the behaviour of the product specific *.so file is different.
    Therefore I am looking for another way of comparing two binary *.so files, in order for me to judge the correctness of the new Clearcase view.
    Does anybody have an idea?
    Thanks
    Dominique

    Thanks Alan for the fast response,
    Unfortunately, I don't have "elfsign" on my system and reading more about the command, I have the impression that this command can verify whether a signature is correct, but in order to do so, the file needs to be signed before, which is not the case here.
    Do you have other suggestions?
    Thanks
    Dominique
    P.s. yesterday, another issue popped up: the *.so files I am referring to are compiled from a whole list of files, and it seems that the "what" command can only check the Clearcase history of the hole list, while in our department, mostly only the impacted files are checked out/checked in for doing an update, and not the hole list of files, causing the "what" command to give erroneous results.

  • Comparing the current time and 10 a.m

    Hi,
    I have to check for the time now and need to check whether it is less than 10.a.m and i have do a process till 10 A.M
    how can i do it?
    Regards,
    Priyanka.

    Priya, please don't cross-post your questions. It's rude to people who might want to answer them.

Maybe you are looking for

  • Resize a ldom zdisk volume

    Hi, I create a zdisk volume on a T5220 (solaris 11) and installed a solaris10 in a ldom. The zdisk size is 50G. After some zone migration inside the ldom, my zdisk is a bit short and I want to increase to 60G. I modified the zdisk size where ldom is

  • Where is the Applet JAR file?

    When an Applet (the JAR) is downloaded to the local PC, exactly where (the directory) we can locate the Applet JAR file? Is the file managed by the Internet browser?

  • Rescue and Recovery 4.3

    I just did a clean install of Windows 7 64 bit Ultimate on my Lenovo 3000 N500. Downloaded Rescue and Recovery 4.3 for Windows 7. It won't install correctly. I get a message that it is only for Lenovo products! How do I "rebrand" my laptop to Lenovo

  • Summing column values in sortable dataset

    http://cccw.ecologik.net/admin/lookup/ Simple page that has a reapting region that is sortable. You notice at the bottom of the table I have a "Total Saved." I would like this to be able to sum up the pSaved column. I know I could get this dynamicall

  • Lightroom Presets "process version"

    I am creating lightroom presets to share (Lightroom 4) I am confused about the box "precess version". Should I click it or not? What will happen if I click it and then there is a lightroom 5? Not sure what is the best choice and why there is even tha