Binary file content check fails!

Hello,
I am finding it hard to capture the content of a binary file.
Here is my code:
  if(!(null == myInstance.getBin_File().toString()) 
                          && !(myInstance.getBin_File().toString().equals(""))){ 
     //    Do something 
    }else{ 
    // Do something else. 
    }  When the binary file is blank, control still goes into "if" instead of "else"!!!!
How should I change the "if" condition so that, whenever the binary file is blank, I wanna execute "else"
Thanks
Srinivas

The purpose of toString() is (supposed to be) to return a string identification of the object. That doesn't necessarily mean the contents of the object; in fact, it normally wouldn't. For example, suppose an object holds a 100,000-word dictionary. It's toString() response could appropriately be "[100,000-word widget dictionary]", and not every word in the dictionary.
So, if you're checking to see if the "xstring", whatever that is, is empty, then using toString() is almost certainly not the way to go, and only would be if "xstring" is really poorly designed and you shouldn't use it anyway.

Similar Messages

  • File Systen Check Fail

    I keep getting a file system check fail after a new install:
    The error message states that "/dev/hda3 could not be read or does not describe a correct ext2 filesystem"
    /dev/hda3 was setup as ext4 and  as /, so I can't really believe this error message.

    Thanks rockin turtle, I did a standard reinstall instead of legacy like you suggested:
    Even though my system didn't have sata, the correct approach was to do a standard install instead of "Legacy IDE".
    This appears to be a bug in the installer right? I couldn't find it in the bug tracker.

  • How can I convert the binary file content to XML message

    Dear friends,
    I poll the binary file from a ftp server but the payload only includes the binary content, no XML structure in the payload, I hope to convert the binary content to a element node within the XML structure, how can I do that? via content conversion?
    Thanks and regards,
    Bean

    Read the binary file stream using java I/O standard functions and convert the read stream to Base64 format. Now map this content to one of the field in target XML structure.
    You need a java mapping for this.
    what is your target system?
    Thanks,
    Gujjeti.
    Hi Gujjeti,
    Thanks a lot for your kind help, my target system is R/3.
    Can I achieve that with a UDF or a simple way?
    Regards,
    Bean

  • BAPI_DOCUMENT_CHECKOUT... get binary file content???

    Hello!
    When i want to check out documents, the Function BAPI_DOCUMENT_CHECKOUT2 only checks the documents out in the unix file system of the server the dms is running. Is there another possibility to get the file content by a JAVA Application to story the file in the local filesystem?

    Hi Marco,
    I tried with the same thing as you mentioned, but its not working. see my code,
    DATA : T_ITAB TYPE SDOKCNTASCS.
    DATA : T_FILETYPE TYPE SDOKFILACIS.
    DATA: T_SKWF_IO LIKE SKWF_IO.
    T_SKWF_IO-OBJID = '44CEB4D549C229FBE100000097A3145C'.
    T_SKWF_IO-CLASS = 'CRM_P_ORD'.
    CALL METHOD CL_CRM_DOCUMENTS=>GET_WITH_TABLE
      EXPORTING
        PHIO                = T_SKWF_IO
        TEXT_AS_STREAM      = 'X'
      IMPORTING
        FILE_ACCESS_INFO    = T_FILETYPE
        file_content_ascii  = t_itab .
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    The table t_itab remains blank after executing the fun. module.
    Regards,
    Kumar.

  • File system check fails "FATAL"

    Dear all,
    after about three of years of running, one of my Xsan filesystems died. The fsm process stops running after about 2 minutes in running state. A filesystem check with cvfsck -w -v <Name> ends with:
    Creating Daten allocation check file.
    Stripe Group Daten ( 0) 0xe8def800 blocks.
    Building Inode Index Database 91458560 ( 52%).
    Fatal: rf_relblk write failed - Input/output error
    Building Inode Index Database 91459584 ( 52%).
    Fatal: Cannot insert inotab for [0x32a9e378800]! -No such file or directory
    Fatal: Cannot build inode tracking tree - Input/output error.
    I cannot see any misbehaviour of the hardware itself. RAID Admin is green everywhere.
    The filesystem size is about 17 TB and the data is quite important. Is there any way to proceed without re-formatting?
    Some more information I found in the log files:
    [0923 16:26:42] 0xa000ed88 (debug) FSS 'Experiments' REGISTERED -> DYING, next e
    vent in 60s
    [0923 16:26:43] 0x1802e00 INFO Disk rescan found 10 disks
    [0923 16:26:43] 0xa000ed88 INFO NSS: Active FSS 'Experiments[0]' at 192.168.100.
    10:49275 (pid 354) - dropped.
    [0923 16:26:45] 0x1801600 ERR Portmapper: FSS 'Experiments' (pid 354) exited on
    signal 4
    [0923 16:26:45] 0x1801600 ERR FSS 'Experiments' appears unstable (2 failures in
    60 minutes or less), halting restarts
    [0923 16:26:45] 0x1801600 (debug) FSS 'Experiments' DYING -> STOPPED (corefile l
    imit exceeded)
    Any hint is really appreciated.
    Best regards,
    Torsten

    Thanks for the hint. Well, the cvfsck -j command succeeded rather quickly. But the -w afterwards fails again:
    Super Block information.
    FS Created On : Wed Aug 31 13:24:34 2005
    Inode Version : '2.3'
    File System Status : Clean
    Allocated Inodes : 173699072
    Free Inodes : 37814385
    FL Blocks : 9309
    Next Inode Chunk : 0x2c05d400
    Windows Security Indx Inode : 0x4
    Windows Security Data Inode : 0x5
    Quota Database Inode : 0x6
    ID Database Inode : 0xb
    Client Write Opens Inode : 0x7
    Creating Daten allocation check file.
    Stripe Group Daten ( 0) 0xe8def800 blocks.
    Building Inode Index Database 91363328 ( 52%).
    Fatal: Cannot insert inotab for [0x8261a053f400]! -No such file or directory
    Fatal: Cannot build inode tracking tree - Input/output error.
    Is there anything else I can do?
    Thanks,
    Torsten

  • Java mapping - for reading the binary file contents and changing filename

    Hi,
    I have already gone through the various bolgs and threads and have not been able to find a solution to my problem.
    One blog did give some idea but did not help- "JAAPPING", an alternate way of reading a CSV file
    I am not very good in java but have been trying some out recently to fulfill the interface requirements.
    I would really appreciate if you could help am I am giving below the detailed scenario below.
    Part 1- working fine - The incoming file looks like:
    :20:STMEMU096868DUBE
    :25:001180256210
    :28C:00371/00001
    :60F:C090617AED742136,92
    :61:0906300630CD34,27FINTCREDIT INTEREST
    26MAY2009 TO 25JUN2009
    :62F:C090630AED742171,19
    :64:C090630AED742171,19
    The file name as received is:TCDE.BLQSAM.SAEA2682.C0084025.A9G24T58.20090724195908
    This file without any conversion is placed on XI server dircetory folder.
    Part 2 - need to develop
    The file should now be renamed according to the incoming value in 2nd line - specifically the 12 digit value 001180256210 and placed on the R/3 dircetory folder.
    The new file name in the above example should be:
    AC_NO_001180256210_datetime
    The module for the above was created and the last time I checked it was working.
    However, when I wanted to do final testing in Dev and move the changes further, the module has seemed to have stopped working so I need an alternate solution fast.
    I was thinking of doing the Java mapping as I will be more in control as to what is going on thereby reducing the dependency.
    There is no need to create any target xml structure as the file as it is needs to be placed in the target folder with a new name.
    I can get the file name in UDF which I have already created but i am not usre if it working.
    Can you please help?
    Any help will be greatly appreciated.
    Regards,
    Archana
    +44-7867636863

    Hi Stephen
    The xml must be getting added in the below part of the code. It is coming from arg[0]
    You can put a check and get it removed.
    while ((len = arg0.read(buffer)) != -1) {
      arg1.write(buffer, 0, len);
    Regards
    Osman

  • Presenting binary file content as HTML inside a Portlet

    Hello folks,
    Do any of you has a piece of code that does that? Grabbing a word doc, pdf, ppt and such and convert it to HTML in order to present it inside a portlet? The easiest way would possibly be to use Dynamic Converter API, right? Is there any licensing problems on using Dynamic Converter on the limited UCM that comes with WebCenter Suite for that?
    Thanks In Advance,
    Pedro Boechat
    Edited by: pboechat on 28/08/2009 10:01

    Carmen,
    There patch available for this bug in metalink ( http://metalink.oracle.com ). You should find the patch in the recent portal patch list. The bug no for this patch is 1574770.

  • Submit into ABAP repository failed (binary file)

    Hi,
    im working with eclipse / sapui5 extension. i really like it. everything works fine.
    exceptional case:
                                  "try to submit a ".cur" file"
    Synchronization failed
    File WebContent/img/openhand.cur could not be submitted
    End of line marker not supported, please use CR+LF: WebContent/img/openhand.cur
    What? "I should add CR-LF to a binary file?" ... why? The CR-LF on textfiles is incomprehensible for me, but on
    binary i cannot understand at all.
    If anyone has a solution, please let me know.

    Hi,
    the solution to submit not currently as binary defined files to abap repository is:
    define your fileextension in ecplise as "binary" as documented in the sapui5 sdk docs.
    SAPUI5 SDK - Demo Kit
    "Submitting the SAPUI5 Application Project to the SAPUI5 Repository"
    When using the team provider the file type is determined based on the Eclipse preferences.
    If you submit binary files and submit fails due to "End of line marker not supported" error,
    the binary file type is probably not registered as binary.
    To change that in Eclipse go to Window → Preferences and then to Team → File Content and register the binary file type as type binary."
    like this...
    faithfully... Danilo.

  • 11.5.10.2 re-install on Windows 2003 fails File Space Check

    Hi,
    After a dodgy staging area ruined my first install, I cleaned out the server as per Metalink Note 124353.1.
    I have recreated my staging area and am now attempting to reinstall Financials. However the pre-install check 'File Space Check' fails even though I have 136GB of free space available!
    Can someone tell me how to reset the server so Oracle sees the correct amount of available free space?
    Thanks,
    Bartoosh

    Hi
    I have encountered some problem. This what I did
    Clean all old stage area
    Clean all Oracle folders (the c:\oracle and c:\program files\Oracle)
    Clean all registry in the LOCAL_MACHINE\SOFTWARE\ORACLE and on SYSTEM\SERVICES. All values regarding any ORACLE installation.
    Clean all temp files from Documents and Settings\USER\Local Settings\Temp and c:\windows\temp
    Clean all Oracle values in path
    Clean Windows trashcan
    Try this, and then create your stage area again, and try to install
    Hope this help
    JailBreak

  • Binary file to variable

    Hi,
    I want to store a binary file content (it is a MS WORD file) onto a java variable (type String ?) to use this variable to create a new file identical by writing this variable value into a new file.
    I tried it as follow :
    1- I read a file using a fileInputString and method read
    2- I got a byte array, converted it in a String and using URLEncoder produced another String
    3- With this encoded String I created a java code that I displayed on System.out, It looks like :
    String content=""
    +"%D0%CF%11%E0%A1%B1%1A%E1%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%3E%00%03%00%FE%FF%09%00%06%00%00%00%00%00%00%00%00%00%00%00%01%00%00%00%21%00"
    +"%00%00%00%00%00%00%00%10%00%00%23%00%00%00%01%00%00%00%FE%FF%FF%FF%00%00%00%00+%00%00%00%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%F"
    +"%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00";Now I have my binary file in a string and using URLDecoder and writing this String into a new file I must obtain a clone of the original file, but when I compare the original file with this file with command cmp I always obtain severals differences (about 10 or 12 bytes that are differents in a total of 180000) I don't know why theses two files are differents, is there a way to obtain a perfect clone ?

    Hi,
    I want to store a binary file content (it is a MS
    WORD file) onto a java variable (type String ?) to
    use this variable to create a new file identical by
    writing this variable value into a new file.If you want to copy a file, never ever use Strings, use bytes!
    Have a look at the IO tutorial how to read a file as a byte stream:
    http://java.sun.com/docs/books/tutorial/essential/io/

  • [solved] Filesystem check fail - Cannot access LVM Logical Volumes

    I am getting a "File System Check Failed"on startup, I recently did a full system upgrade but I'm not entirely sure that the cause of the issue as I don't reboot very often.
    I get the error right before this line is echo'ed out:
    /dev/mapper/Arch_LVM-Root:
    The super block could not be read or does not describe a correct ext2 filesystem...
    this is odd because the only ext2 filesystem I have is on an non-LVM boot partition...
    I can log-in and mount / as read/write and I can activate LVM with
    modprobe dm-mod
    and
    vgchange -ay Arch_LVM
    and they show up in lvdisplay but their status is "NOT available"
    I just need to mount these logical volumes so I can retrieve some personal data in my home directory, I am also hesitant to use LVM again if I can't retrieve my data.
    any suggestions?
    Last edited by action_owl (2010-08-15 02:15:58)

    I just popped in the install disk and was able to mount and access the LVM groups as expected, something must have been wonky with my filesystem

  • Post install checks failed for DBC file - Oracle App11.5.10.2 Linux  5.3

    Hi everybody,
    I tried Installing Oracle E-Business Suite 11.5.10.2 on Red Hat Enterprise Linux Server release 5.3
    The Post install checks failed for DBC file, HTTP, JSP and PHP. Apparently the DBC hadn’t been created. I had verified the log file, while executing adgendbc.sh, it throwing below error.
    Generating /jith/d01/oracle/appl/visappl/fnd/11.5.0/secure/prithvi.bangalore.bedford.local_vis.dbc
    DBC generation failed with exit code 127
    Generating /jith/d01/oracle/appl/visappl/fnd/11.5.0/secure/prithvi_vis.dbc
    DBC generation failed with exit code 127
    Updating Server Security Authentication
    Updating Server Security Authentication failed with exit code 127
    adgendbc.sh exiting with status 127
    ERRORCODE = 127 ERRORCODE_END
    .end std out.
    touch: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory
    sqlplus: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
    mkdir: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
    grep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
    sed: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
    /jith/d01/oracle/appl/viscomn/util/java/1.4/j2sdk1.4.2_04/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory
    cp: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
    /jith/d01/oracle/appl/viscomn/util/java/1.4/j2sdk1.4.2_04/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory
    cp: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
    /jith/d01/oracle/appl/viscomn/util/java/1.4/j2sdk1.4.2_04/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory
    cp: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
    /jith/d01/oracle/appl/viscomn/util/java/1.4/j2sdk1.4.2_04/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory
    /jith/d01/oracle/appl/viscomn/util/java/1.4/j2sdk1.4.2_04/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory
    .end err out.
    Thanks in advance.
    sreejith

    Welcome to the forums !
    Pl post EBS related question in the EBS forums at http://forums.oracle.com/forums/category.jspa?categoryID=3
    HTH
    Srini

  • How to send the entire binary file as Content in mail adapter

    Hi,
    I have the below scenario:
    A binary file is there on the XI server and this is more than 1 lines.
    This file needs to be sent across to certain email addresses via the XI interface.
    I have made the design and config and now get the the mail but so far not been able to get the file contents.
    The requiremnet is to send the entire file contents in the mail so that they appear in the body of the received mail.
    How do i do it?
    Can you please advice.
    Regards,
    Archana

    Hi,
    I am giving below the incoming mesasge details and the outgoing Mail message details.
    Sender File Adapter:
    Mesasge Content/Payload:
      <?xml version="1.0" encoding="utf-8" ?>
    - <ns:MT_Ack_Mail_In xmlns:ns="Urn:Serco-com:interface:Banking:HSBC:FileTransfer">
    - <Content>
    - <Mail>
      <Details>UNBUNOA:3HEXAGON-ABCABC10268002081201:2152+692125127893</Details>
      </Mail>
    - <Mail>
      <Details>UNH1CONTRL:2:2:UN:APACS</Details>
      </Mail>
    - <Mail>
      <Details>UCI1000246720ABC10268002HEXAGON-ABC4+C09</Details>
      </Mail>
    - <Mail>
      <Details>UNT31</Details>
      </Mail>
    - <Mail>
      <Details>UNZ1692125127893</Details>
      </Mail>
      </Content>
      </ns:MT_Ack_Mail_In>
    Receiver Mail Adapter:
    Message Content/Payload:
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
      <Subject>ME-Acknowledgement</Subject>
      <From>email of from</From>
      <To>my email</To>
      </ns1:Mail>
    I need to map the contents of the incoming payload Contents/Mail/Details (all the 5 instance) to outgoing Missing Content (after To field).
    If it can be in Mail body, then it would be best else please suggest what other option can I use?
    Also, If i want the file name to be in the subject of the mail, is that possible to be picked up in the configuration?
    Please help.
    Regards,
    Archana

  • ERROR :Conversion of file content to XML failed at position 0

    Hi Frnds,
    I have a File to File scenario, while testing I am getting the following error:
    Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR converting document line no. 1 according to structure 'TA_830':java.lang.Exception: Consistency error: field(s) missing - specify 'lastFieldsOptional' parameter to allow this
    Can any one please tell me why Iam getting this error even I have provided the following informantion in channel configuration. Here TA_830 is the record name.
    TA_830.processFieldNames     fromConfiguration
    TA_830.fieldNames     SEG_NUM,PROCESS_DATE,PAYEE_BCODE,ISSUE_SEQ_NUM,CR_DATE,PAYER_BCODE,PAYER_ID,ENTRY_SEQ_NUM,TRAN_TYPE,PAYMENT_TYPE,PROCESS_FLAG,REF_NUM,PAYER_ACC,VAL_DATE,ISO_CURRENCY,AMOUNT,RESV_11,SEG_NUM,EXCHG_RATE,ADDR1,ADDR2,ADDR3,ADDR4,RESV_18,SEG_NUM,BANK_ID,BANK_CODE,ADDR1,ADDR2,ADDR3,ADDR4,RESV_5,SEG_NUM,ACCOUNT,ADDR1,ADDR2,ADDR3,ADDR4,RESV_6,SEG_NUM,MESSAGE1,MESSAGE2,MESSAGE3,MESSAGE4,RESV_6,SEG_NUM,MESSAGE1,MESSAGE2,MESSAGE3,MESSAGE4,RESV_6,SEG_NUM,PROCESS_DATE,PAYEE_BCODE,ISSUE_SEQ_NUM,CR_DATE,PAYER_BCODE,PAYER_ID,ENTRY_SEQ_NUM,TRAN_TYPE,PAYMENT_TYPE,PROCESS_FLAG,TOTAL_AMOUNT,RESV_59
    TA_830.fieldFixedLengths     2,6,12,5,6,7,5,5,3,1,1,16,24,6,3,15,11,2,12,24,24,24,24,18,2,1,24,24,24,24,24,5,2,24,24,24,24,24,6,2,30,30,30,30,6,2,30,30,30,30,6,2,6,12,5,6,7,5,5,3,1,1,16,59
    TA_830.fieldContentFormatting     nothing
    Regards,
    Shiva.

    Hi,
    As you are using Fixed Length File...use below specified parameters:
    TA_830.fieldName:          Names of Fields in teh File
    TA_830.fieldFixedLegths: Lenghts as per your file
    TA_830.keyFieldValue:    If you use any value as key
    TA_830.lastFieldsOptional: YES
    TA_830.endSeparator :        'nl'
    This will help you out..
    Thanks,
    Kishore.

  • Error Message: Conversion of file content to XML failed at position 0: sun.

    Hi Experts,
    i strugle with a File 2 IDOC Scenario.
    In the sender communication channel monitoring I get the error message:
    Conversion of file content to XML failed at position 0: sun.io.MalformedInputException
    Unfortunately I am not getting any further information and I do not know where the file-adapters problem is.
    Tthe .fieldSeparator = # . Can this be the problem, that the file-adapter-engine can not handle # within file conversion? I also tried it with .fieldSeparator = '#' . But the error message is the same.
    I am glad for any hints.
    Thank you for your help in advance.
    Regards,
    Udo

    Hi Udo,
    The error is due to wrong intput.
    putting # might be a reson.
    You Can try (,) or a space as a field separater.
    Can you test this once.
    Have to defined the field separated?
    Regards,
    Sumit Gupta

Maybe you are looking for

  • Can I save my playlist to a flash drive?

    I need to switch my song library (playlist) from one computer to a new one. Is it possible to save all the songs on my flash drive? If so, please give specific instructions...no tech guru here.

  • CS4 loading RAW images very slowly

    I just upgraded from CS2 to CS4 to support my new Canon 50D RAW file format. It is taking Photoshop about 12 seconds to open each file, and this is a real killer when running a batch. Is this typical with these huge 15MP images? I am running a 2.8Ghz

  • Reg:SC between plants with new material

    Hi all, Iu2019ve a scenario as follows, SC process between plants Plant X &  Plant Y Plant X sent material C to get the material A which goes as normal SC purchase order After the material reaches the plant Y it adds new material B(excisable) to this

  • I have lost my facetime

    I cannot find facetime on my iphone 4. i have version 4.3.3.  I actually updated my phone in UAE and then facetime disappeared. facetime is banned in uae but now I am in australia i want to have facetime.. someone pls help me get it back !! thanksss

  • Narrowing down by keyword

    The apple help site says this To find photos that contain a specific keyword: To display photos that contain a specific keyword, click the keyword in the Keywords list. You can select more than one keyword to narrow your search. To hide photos that c