Report success or failure

I have the following code:
import java.io.File;
import java.lang.String;
public class rename {
   public rename() { }
   public static boolean fileRename(String oldName, String newName) {
      File src = new File(oldName);
      File dst = new File(newName);
      boolean done = src.renameTo(dst);
      return done;
   public static void main(String[] args){
      fileRename(args[0], args[1]);
}How would I return a true or false back depending how if the code was successful or not?
Thanks

   public static void main(String[] args){
      if (  fileRename(args[0], args[1]) )
          System.out.println("Successful");
      else
          System.out.println("Fail to rename the file");
   }will print to the System console if your method was successful or not.

Similar Messages

  • Reporting success or failure of labview command line build

    We've set up a nightly build for our project, using a batch file for compiling the C++ code in our project on Windows. Thanks to some other posts on this subject, we've gotten the command-line build to work in Labview 8.2. I'd like to add the Labview build command to same batch file as the C++ build. We found how to check within Labview if the project built or failed; however, I didn't see a way to report the success or failure status of the build from the Labview environment back up into the calling batch file (as/just before Labview exits).
    One option is to have the batch file check for the existence of the Labview output executable file(s). Does anyone have a more elegant solution?
    Thanks,
    Adam

    Hello Adam,
    Based on what you have described, your method seems to be the simplest way to do it.  You can not only check whether the executable files were created, but you can also check to see the modification dates to make sure that they are from the latest build.
    body { margin: 0 0 0 0; padding:0 0 0 0 }
    td,div { font-family:Arial;font-size:10pt;vertical-align:top }
    body { margin: 0 0 0 0; padding:0 0 0 0 }
    .transcript { background-color:#d2d2d2; }
    .messageBlock { margin-left:4px; margin-bottom:3px }
    .message { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-spacere; }
    .messageCont { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-spacere;}
    .other { color:#39577a;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .myself { color:#da8103;font-style:normal;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont { font-size:8px;text-align:right; color:#39577a;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .myselfCont { font-size:8px;text-align:right; color:#da8103;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .system { margin-left:4px; word-wrap:break-word;color:#da8103;font-style:normal;font-weight:normal; white-space:-moz-pre-wrap; _white-spacere; }
    .showTimestamp { margin-right:3px; float:right; color:#999999;font-style:normal;font-weight:normal; }
    .other1 { color:#ac2000;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont1 { font-size:8px;text-align:right; color:#ac2000;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .other2 { color:#3c9fa8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont2 { font-size:8px;text-align:right; color:#3c9fa8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .other3 { color:#e25614;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont3 { font-size:8px;text-align:right; color:#e25614;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .other4 { color:#0b6ac8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont4 { font-size:8px;text-align:right; color:#0b6ac8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .other5 { color:#b23290;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont5 { font-size:8px;text-align:right; color:#b23290;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .other6 { color:#02e7c7;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont6 { font-size:8px;text-align:right; color:#02e7c7;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .other7 { color:#5b3284;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont7 { font-size:8px;text-align:right; color:#5b3284;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .tsDisplay { display:block }To check if they exist, you can use the following batch command to check if a file exists:
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    IF EXIST some.txt DOSOMETHING
    Good luck!
    Kameralina
    Ask NI (ni.com/ask)
    Search The KnowledgeBase
    NI Developer Zone
    Measure It. Fix It. ni.com/greenengineering/
    NI Vision ni.com/vision/

  • Success and Failure messages Report

    Hi All,
              Could you advice if it is possible within SAP XI to generate a report or list of messages with sender party, receiver party and timestamp for reference. Say end of day we need to run a report of how many successful message passed thru XI and the messages that failed. In XI we can see that, but can we generate a report out of automatically at the end of the day, or mail it to a particular e-mail address?
    Can I create a spreadsheet report of all the success and failure messages with the time, sender party, receiver party automatically whenever desired.
    Thanks in advance
    Ravijeet

    It is possible. Have a look at this blog have more idea on the table that needs to be used to pick the messages and the details.
    [How-to enrich XI monitor's output|How-to enrich XI monitor's output]
    Thanks
    SaNv...

  • Dont want to display "Report Successfully Run" applet

    Dear Users....I Dont want to display "Report Successfully Run" applet after my report runs successfully. I'm calling report from Forms-10g Rel.2 and my browser is Internet Explorer ver.6. I'm sending my report directly to printer using Web.Show_Document.If my report is sent to printer successfully there is no need to display browser window with the above mentioned message. Is there any solution for this???

    Code in when-button-pressed
    DECLARE
    V_Usr_Prm Varchar2 (1000);
    BEGIN
    V_Usr_Prm :=
    'FROM_REF_NO='
    || P_FRM_REF_NO
    || '+TO_REF_NO='
    || P_FRM_REF_NO
    || '+P_PRE_BY='
    || P_PRE_BYE
    || '+P_VR_TYPE='
    || P_VOR_TYP
    || '+YEAR1='
    || P_VOR_YER
    || '+MNU_IDE=0'
    || '+P_PRN_FLG=1';
    web_show_document_proc ('HTMLCSS', 'Y:\02\\02\VOR_PRN.REP', V_USR_PRM);
    END;
    Procedure Web_Show_Document_Proc is
    PROCEDURE WEB_SHOW_DOCUMENT_PROC (runformat varchar2,
    reportname varchar2,
    userparameters vARCHAR2)
    IS
    i NUMBER (10);
    v_a VARCHAR2 (10);
    v_b VARCHAR2 (10);
    vc_url VARCHAR2 (1000);
    vc_url_temp VARCHAR2 (1000);
    vc_user_name VARCHAR2 (30) := GET_APPLICATION_PROPERTY (username);
    vc_user_pw VARCHAR2 (30) := GET_APPLICATION_PROPERTY (password);
    vc_user_connect VARCHAR2 (30)
    := GET_APPLICATION_PROPERTY (connect_string) ;
    BEGIN
    vc_url :=
    'userid='
    || vc_user_name
    || '/'
    || vc_user_pw
    || '@'
    || vc_user_connect;
    FOR i IN 1 .. LENGTH (vc_url)
    LOOP
    v_a := LTRIM (TO_CHAR (TRUNC (ASCII (SUBSTR (vc_url, i, 1)) / 16)));
    IF v_a = '10'
    THEN
    v_a := 'A';
    ELSIF v_a = '11'
    THEN
    v_a := 'B';
    ELSIF v_a = '12'
    THEN
    v_a := 'C';
    ELSIF v_a = '13'
    THEN
    v_a := 'D';
    ELSIF v_a = '14'
    THEN
    v_a := 'E';
    ELSIF v_a = '15'
    THEN
    v_a := 'F';
    END IF;
    v_b := LTRIM (TO_CHAR (MOD (ASCII (SUBSTR (vc_url, i, 1)), 16)));
    IF v_b = '10'
    THEN
    v_b := 'A';
    ELSIF v_b = '11'
    THEN
    v_b := 'B';
    ELSIF v_b = '12'
    THEN
    v_b := 'C';
    ELSIF v_b = '13'
    THEN
    v_b := 'D';
    ELSIF v_b = '14'
    THEN
    v_b := 'E';
    ELSIF v_b = '15'
    THEN
    v_b := 'F';
    END IF;
    vc_url_temp := vc_url_temp || '%' || v_a || v_b;
    END LOOP;
    vc_url :=
    '/reports/rwservlet?server=rep_appsrv_frhome1+'
    || vc_url_temp
    || '+report='
    || reportname
    || '+destype=Printer+desformat='
    || runformat
    || '+paramform=No+'
    || userparameters;
    WEB.SHOW_DOCUMENT (vc_url, '_blank');
    END;

  • Dont want to display "Report Successfully Run"

    Dear Users....I Dont want to display "Report Successfully Run" applet after my report runs successfully. I'm calling report from Forms-10g Rel.2 and my browser is Internet Explorer ver.6. I'm sending my report directly to printer using Web.Show_Document.If my report is sent to printer successfully there is no need to display browser window with the above mentioned message. Is there any solution for this???

    Code in when-button-pressed
    DECLARE
    V_Usr_Prm Varchar2 (1000);
    BEGIN
    V_Usr_Prm :=
    'FROM_REF_NO='
    || P_FRM_REF_NO
    || '+TO_REF_NO='
    || P_FRM_REF_NO
    || '+P_PRE_BY='
    || P_PRE_BYE
    || '+P_VR_TYPE='
    || P_VOR_TYP
    || '+YEAR1='
    || P_VOR_YER
    || '+MNU_IDE=0'
    || '+P_PRN_FLG=1';
    web_show_document_proc ('HTMLCSS', 'Y:\02\\02\VOR_PRN.REP', V_USR_PRM);
    END;
    Procedure Web_Show_Document_Proc is
    PROCEDURE WEB_SHOW_DOCUMENT_PROC (runformat varchar2,
    reportname varchar2,
    userparameters vARCHAR2)
    IS
    i NUMBER (10);
    v_a VARCHAR2 (10);
    v_b VARCHAR2 (10);
    vc_url VARCHAR2 (1000);
    vc_url_temp VARCHAR2 (1000);
    vc_user_name VARCHAR2 (30) := GET_APPLICATION_PROPERTY (username);
    vc_user_pw VARCHAR2 (30) := GET_APPLICATION_PROPERTY (password);
    vc_user_connect VARCHAR2 (30)
    := GET_APPLICATION_PROPERTY (connect_string) ;
    BEGIN
    vc_url :=
    'userid='
    || vc_user_name
    || '/'
    || vc_user_pw
    || '@'
    || vc_user_connect;
    FOR i IN 1 .. LENGTH (vc_url)
    LOOP
    v_a := LTRIM (TO_CHAR (TRUNC (ASCII (SUBSTR (vc_url, i, 1)) / 16)));
    IF v_a = '10'
    THEN
    v_a := 'A';
    ELSIF v_a = '11'
    THEN
    v_a := 'B';
    ELSIF v_a = '12'
    THEN
    v_a := 'C';
    ELSIF v_a = '13'
    THEN
    v_a := 'D';
    ELSIF v_a = '14'
    THEN
    v_a := 'E';
    ELSIF v_a = '15'
    THEN
    v_a := 'F';
    END IF;
    v_b := LTRIM (TO_CHAR (MOD (ASCII (SUBSTR (vc_url, i, 1)), 16)));
    IF v_b = '10'
    THEN
    v_b := 'A';
    ELSIF v_b = '11'
    THEN
    v_b := 'B';
    ELSIF v_b = '12'
    THEN
    v_b := 'C';
    ELSIF v_b = '13'
    THEN
    v_b := 'D';
    ELSIF v_b = '14'
    THEN
    v_b := 'E';
    ELSIF v_b = '15'
    THEN
    v_b := 'F';
    END IF;
    vc_url_temp := vc_url_temp || '%' || v_a || v_b;
    END LOOP;
    vc_url :=
    '/reports/rwservlet?server=rep_appsrv_frhome1+'
    || vc_url_temp
    || '+report='
    || reportname
    || '+destype=Printer+desformat='
    || runformat
    || '+paramform=No+'
    || userparameters;
    WEB.SHOW_DOCUMENT (vc_url, '_blank');
    END;

  • Reports successfully execute but generate a login failed for user 'sa' err

    I am running Crystal Reports Server XI R2. Classic ASP is used to generate embedded reports within our application. The crystal reports use ODBC to connect to a SQL Server 2005 database. The reports successfully generate in our Classic ASP application. However in SQL Server 2005,  the following error messages are being generated each time a crystal report is ran:
    - Login failed for user 'sa'.
    - Error: 18456, Severity: 14, State: 8.
    We know that we are passing the correct username/password to the crystal reports, becuase they execute successfully.
    It appears that when the report is called, Crystal Reports appears to conect to SQL Server using a username/password that we didn't provide it at execution time, this fails and the SQL Server 'login failed for user' is generated. Then it runs the report using the username/password we provide and it successfully generates a report.
    I have ran Profiler against the SQL Server Database and the 'Login failed for user 'sa' ' errors have a ApplicationName of either 'Seagate Crystal Reports' or 'Crystal Reports'. Therefore I know it is Crystal Reports generating these errors in SQL Server.
    Does anyone have any ideas on how to stop these SQL Server 'Login failed for user 'sa' ' errors being generated?

    What happens if you use Profiler when running the report using Crystal Report Designer?
    If the report is ran through Crystal Report Designer, NO 'Login failed for user' error messages appear in profiler. Everything looks ok when ran in Designer.
    Also, need to know what patch level you are on?
    We are running Crystal Reports Server XI Release 2, Version: 11.5.8.8265
    No additional patchs have been applied since Crystal Reports Server was installed.
    We may try the SA account if one of the connections fail to log on with the credentials you provided. Verify the user you logged on with has rights to all tables.
    The reports were running through our application using the SA account. The SA account has permissions to these tables. The reports do generate results and appear perfectly fine in the application.  The issue is that when our application requests the report from Crystal Reports Server. Crystal Reports Server delivers the correct report to our application. However during the process to generate the report, 'login failed for user 'sa' ' errors are being generated in SQL Server 2005.
    Also, I have tried creating a completely new SQL user called 'crystaluser'. I ran the report using Crystal Report Designer and used the crystaluser logon and saved the report. Then I ran the same report through our application. SQL Profiler will then display 'login failed for user 'crystaluser''. 
    Its seems as though Crystal Reports Server is first executing the report using the default SQL user saved with the report, but is either sending a blank password or no password at all. This generates the 'login failed for user' in SQL Server 2005. But it then uses the SQL username/password my application gives it and successfully generates the report. Of course this is only speculation.

  • How to check the Success or Failure of a command

    Hi,
    I have forms 10g in which I made delete button on a tabuler canvas behind the button I wrote DELETE_RECORD buil-In, I want to know how can I make sure the delete process is successful or fail.
    Thanks in advance.
    Khawar

    Hi Francois,
    I will check detail in Help for Form Success and Failure, Thanks for reply.
    Khawar

  • Need to send success or failure message to BAPI of SQL query action block

    Hi All,
    I need to send success or failure message(i.e. 1 or 0) to BAPI which has been called below sql query action block in transaction
    Here in SAP, i have created on BAPI with one import parameter and one export parameter.
    In the sql query action block, it insert records in the database table. If it fail or success, that message(numeric value 1 or 0) has to send to SAP program through BAPI.
    I have created a SAP ABAP program which sends message to MII Message listener through RFC then in the process rule message it will call transaction, in transaction, sql query will insert records into database table.  if it success or fail, it will pass to BAPI. And i calling that BAPI in the same SAP ABAP Program to show in the output screen.
    Here the issues, i am not getting the value from BAPI which has send by the transaction in MII.
    SAP Jco, I have mapped in conf. links --> BAPI input with sql query sucess
    Thanks,
    Kind Regards,
    Praveen Reddy M

    Dear All,
    I am facing problem regarding completion notifications in Oraclr r12, when user click the upon completion generated notifications it can only be viewd once, second time user cannot view the notifications.
    I have find that fnd_file_temp table store this information and deleted it.
    Plz help me how to view this URL again.
    thanks
    regards,
    Zubyr

  • SuSE 8.0 9iAS R2 and 9iDB R2 - Reporting Success

    Hi All,
    I'm just writing in to report Success on SuSE ver. 8.0 (The Internet D/L'ed version) for...
    Oracle 9iAS Release 2 (Yes Portal is working) and
    Oracle 9iDB Release 2
    I currently have install documents that I put together for these particular installs. I do need to update the document to correct some errors that I discovered when testing the procedures, and should have that done in a few days to a week.
    If anyone is interested in this documentation, go ahead and drop me an email. Put "ORACLE9iAS-R2-SUSE-8.0" or "ORACLE9iDB-R2-SUSE-8.0" in subject. When the documentation is complete I will forward it to you. I will be most especially interested in any problems that people identify with these procedures. I'm also interested in anyone who can provide some hosting space for these documents.
    BTW, I do not check these forums daily, so do not expect a reply immediately if you post here.
    t z c j r @ a t t b i . c o m
    - Obviously you remove the whitespace : )
    Cheers,
    Tim

    Hi
    I installed on SUSE Linux 8.0 the 9iAS R2, only the option A - J2EE and WebChache. Now I have following problems.
    1. Some configuration tools (OC4J, OPMN, DCM)were not initialized in the end of the installation. I read other postings with the same problems, but i never read a solution of these problems.
    2. After installation, i want to start the http server manually (dctml start -ct ohs) , but it doesn't work. I got the error message ADMN 100999, i dont know why !
    If i want to start the http-server with enterprise manager (EM worked partically) I got an EMException.
    I have no idea to resolve the problems, perhaps you
    Thank You

  • OWB 10.2 Phantom Phailures - mapping reports success but no data!

    Hi all,
    I've been getting more and more mapping jobs that run for their normal duration but do not update anything in OWB 10.2 against a 10.2 database. I see the following symptoms:
    1. The finish time is set to the start time of the mapping when this occurs even though the mapping runs for a long time.
    2. The job reports success with no errors
    3. The job shows "*" for the table stats of whatever table or dimension level it was working on
    4. There is nothing in the alert logs or trace files
    This is sporadic! Rerunning the same mapping might work the next time. I logged an SR but was wondering if I'm the only one experiencing this. I'm running manually from design center when this occurs.
    It looks like something is aborting the mapping but not reporting any error anywhere. Any ideas?
    Thanks,
    Mike

    Thanks for your reply. I've been in contact with support and I get the following in the logs. They indicated that the error creating temp is not a problem but as you see there is a recovery and a forced termination of the job. No idea why and so far, neither have they. If I can't get error returns from OWB, I can't put it into production! I hope its something odd on my end and not a global problem.
    2006/09/08-08:48:26-EDT [64F6CD] Error creating the temp directory C:\oracle\OWB\owb\temp
    2006/09/08-08:48:29-EDT [64F6CD] Free Memory(bytes)=642664 Total Memory(bytes)=2031616 Used Memory(bytes)=1388952 Used Memory(percent)=69%
    2006/09/08-08:48:29-EDT [64F6CD] Runtime Platform Service Version 10.2.0.1.31 starting
    2006/09/08-08:48:29-EDT [64F6CD] Platform Repository Name DW_REPOS on Service DWDEV at Host FLSUS-DBWHSE1
    2006/09/08-08:48:29-EDT [64F6CD] Explicit garbage collection - every 1 execution(s)
    2006/09/08-08:48:30-EDT [64F6CD] Recovery starting
    2006/09/08-08:48:31-EDT [64F6CD] Forcibly deactivating execution with audit ID 37777
    2006/09/08-08:48:31-EDT [64F6CD] Service startup complete

  • SSIS Package execution completes without giving any success or failure message

    Hi,
    We are using SSIS to load some 100k records from flat file to Oracle Destination. We are using Oracle 10g client.
    But during the execution after some 5hrs or 6hr with 900k records upload we are getting the message Package execution completed. In the Execution results there is no message related to success or failure and the tasks in the Data Flow where yellow in color. What might be the problem? Any information regarding this case will be helpful for us.
    Regards,
    Roopa.

    Usually you will have a red object somewhere in your package if there was a failure.  Make sure you are looking in both the Control Flow and all the Data Flows in the package for a red object.  In the execution results in the far right tab, usually you will see several warning messages somewhere in the list of steps, followed by a message that says you have exceded the number of errors for the package and that it is failing.  This is not at the bottom but where the errors actually occur in the flow of messages.
    I don't know if that helps, but that is about all I can add.  Good luck.

  • Custom success and failure messages on quiz results slide

    I'm trying to create a custom success and failure message on the quiz results slide, using certain colours in the text caption to reflect our company's brand. So I've added an advanced action on entering the slide so that if the quiz percentage is 80% or more, the success message shows, and the failure message hides. It seems that this should work, but for some reason, only the failure message displays, regardless of whether I fail or pass. Has anyone else tried this with any success?
    Thanks for your help!

    I've changed the retake and continue buttons to image buttons, then added my custom success and failure captions which I've named 'fail_f' and 'pass_f':
    And here is my advanced action on entering the quiz results slide:
    The hide-button, is a white rectangle that I added so that I could place it over the retake button if they passed the quiz successfully. 

  • Audit of success or failure certification services

    hello
    i have a scenario that i'm using a adcs server and i cannot see any audit of success or failure
    i wish to get some more information about how to exposing an events on my server for 
    certification services auditing
    thanks in advanced
    morgan

    Hey Morgan 
    Thanks for posting ,
    By default the ADCS server on his certification services auditng not configured ,
    to be able to see an events You'v must Enable the auditing as the follow below:
    after doing changes please update.
    I'd be glad to answer any question

  • Quiz Success and Failure Captions

    Is it possible to set the length of time a quiz success or
    failure caption is displayed for the user? I thought I saw settings
    somewhere but for the life of me can't figure out where to do this.
    Thanks - Helen

    Hi betty's mom
    Unfortunately this is the way it has always worked in
    Captivate. Actually, version 2 is a step better, as the caption
    text is no longer misleading. (In Captivate 1, the text said
    Correct/Incorrect - Click to continue, which implied you had to
    click directly on the caption in order to proceed.)
    If you strongly feel you should have the abiity to have them
    simply disappear after a pre-determined period of time, please
    submit an Enhancement Request. You may do this by
    clicking
    here.
    Cheers... Rick

  • SQL Server Reporting Services Subscriptions - Failure sending mail

    Hello All,
      I am having a problem with using subscriptions to send my reporting services report by email.
      Getting the following error:
     Failure sending mail: The message could not be sent to the SMTP server. The transport error code was 0x800ccc6d. The server response was 552 Error: message too large
    While browsing for other reports in the report manager(reports created by others staffs), i could find that these reports were sent by email successfully.
    So not understanding why mine has a problem. logically it could be that the report is too big?
    Anybody has a solution or suggestion?
    Thanking you in advance

    Hi LenitaS,
    For first question, we can check the item "IncludeLink" to embed the link in the mail. Or, embed the link the manually by putting a link in the "Comment" field. The URL should be a standard URL Access:
    http://<reportserver>/reprotserver?/reportpath&rc:format=<format>
    For the second question, you are right. We can follow these setps to work around the issue:
    1.Create a file shared subscription, save the export to a shared folder.
    2.Create a E-Mail delivery subscription, embed the file's path in the mail. We can set the file's path in "Comment" field of the E-Mail delivery. The path should be someone like this:
    \\<sharedfolder>\<export report> 
    In this case, the exported report's name cannot be dynamic.
    If there is anything unclear, please feel free to ask.
    Thanks,
    Jin ChenJin Chen - MSFT

Maybe you are looking for