File IO - how to read file (not contents)

hello, i need to stream the file (everything, not just the contents) into a stream cipher in J2ME. the cipher (using BouncyCastle's API) has already been written, but i need to somehow stream the bytes of the file into it.
how do i do that?
and then, how do i pass in the decrypted stream into a media player to play the audio stream?

Hi Santosh,
I am using the Java code inside the BPEL. In BPEL by using the Java embedding activity, I am calling the java class code. Please follow the below steps to achieve this
1. Create a Java project in jdeveloper and write the java code to read and extract contents of a zip file.
2. Create a zip file for java code
3. To use the java code in your BPEL. Please copy the java code zip file in soa composite SCA-INF\lib folder location
4. Now by using the java embedding activity and some required java package call the required the java class in BPEL
<bpelx:exec import="java.io.File.*"/>
<bpelx:exec import="java.io.FileInputStream.*"/>
<bpelx:exec import="java.io.FileOutputStream.*"/>
<bpelx:exec import="java.io.IOException.*"/>
<bpelx:exec import="oracle.xml.parser.v2.XMLElement"/>
<bpelx:exec import="java.util.List.*"/>
<bpelx:exec import="java.util.ArrayList.*"/>
<bpelx:exec import="java.util.zip.ZipEntry.*"/>
<bpelx:exec import="java.util.zip.ZipInputStream.*"/>
<bpelx:exec import="java.util.zip.ZipOutputStream.*"/>
5.There is no need to register the java code zip file at Soa server
6. Use the following Java embeeding code
FileUnzip unZip = new FileUnzip();
String INPUT_ZIP_FILE = (String)getVariableData("INPUT_ZIP_FILE");
String OUTPUT_FOLDER = (String)getVariableData("OUTPUT_FOLDER");
unZip.unZipIt(INPUT_ZIP_FILE, OUTPUT_FOLDER);

Similar Messages

  • How to read outlook email content that is sent to specific Email ID

    Hi Friends.
    I have the following requirement.
    When an outlook Email is sent from some specifc third party system(Say for Example @gmail.com) to some service Email ID account([email protected]), then I should be able to read the Email using SAP and forward it to my approver's Email ID([email protected]).
    I have followed the below blog to do the basic configuration
    Receiving E-Mail and processing it with ABAP - ... | SCN
    But this blog has no information on how to read the mail content.
    Please help me in resolving this issue.
    Thanks,
    Peri

    Forgotten Security Questions/Answers
    You need to contact Apple by:
    1 - Use the Express lane and start here:
    https://expresslane.apple.com
    then click More Products and Services>Apple ID>Other Apple ID Topics>Forgotten Apple ID security questions.
    or
    Apple - Support -form iTunes Store - Contact Us
    2 - Call Apple in your country by getting the number from here:
    http://support.apple.com/kb/HE57
    or           
    Apple ID: Contacting Apple for help with Apple ID account security
    3 - Use your rescue email address if you set one up
    Rescue email address and how to reset Apple ID security questions
    For general  information see:
    Apple ID: All about Apple ID security questions

  • How to read xml node content from java[ urgent]

    My tag is
    <person1> a="hello">
    <person><first>Steve</first></person>
    </person1>
    I want if i read <person1> tag then it store its inner content in a string.
    i.e my output should be
    <person><first>Steve</first></person>

    Hi, parse the file using dom.then print out the root tag.you will have to strip the indentation this way.or you could use sax.

  • How to migrate Lotus Notes content migration to SharePoint 2013 by using interop.domino.dll?

    I already read this blog "http://sharepoint-community.net/forum/topics/lotus-notes-to-sharepoint-2013-migration?commentId=6614983%3AComment%3A94114&xg_source=activity"
    In this just the information is not that good enough. I need more details and clarity about the interop.domino.dll ?
    Ramesh S

    Hi Ramesh,
    Here are some posts about this topic of get info from Lotus notes, which should help, you can take a look.
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/96b405b4-2550-42c2-9126-3872c51b9515/im-looking-for-the-difinitive-guide-on-the-domino-library-within-net-vs-2008?forum=csharpgeneral
    http://www.ibm.com/developerworks/lotus/library/domino-msnet/
    https://naimmurati.wordpress.com/2014/01/11/basic-operations-with-domino-net-api-for-export-purposes/
    http://rprabhala.com/2013/01/retrieving-documents-and-their-attributes-from-lotus-domino-using-the-com-based-api/
    http://stackoverflow.com/questions/4264434/documentation-for-the-lotus-notes-domino-dll-respectively-interop-domino-dll
    For further more about interop.domino.dll documentation, I would recommend you post in lotus forums for a better assistance with more experts regarding this field.
    http://www.ibm.com/developerworks/lotus/forums.html
    Thanks
    Daniel Yang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to read notes data in FBV3 transaction code

    Hi Experts,
    When i go to Tcode FBV3 parked vendor invoice i have tab notes along with workflow, tax, withholding tax tabs. Notes contains  item long text, my requriement is i need to get this data into my report, i have tried but i couldn't able to get the details like Text Name, Language, Text ID and Text Object to pass it to READ_TEXT function module. Kindly suggest how to read this notes data.
    Regards,
    Sridhar

    Sorry, but this issue is not Asset Accounting.

  • How to read contents of files that do not fall under public security group?

    Hi,
    I need to read the contents of a WCM based xml file that does not fall under public security.
    The process is like this:
    First the user makes chnages to the content.
    The workflow will be triggred based on the security group metadata that is associated with the content.
    Once the content is finally approved our workflow calls a custom idoc script.
    First we tried directly reading the xml contents from the idoc script which was still in the context of workflow. But since content item is still in workflow I was not able to read the changes. So I created a separate content publisher thread and read the DOC_INFO and checked for the dStatus value. If the value is RELEASED then I reading contents by calling ssIncludeXml idoc script.
    This was working fine for public content. But now the requirement is that all content cannot be public. Content authors should not be able to edit the content that does not belong to their group, So we created security groups (and roles) and are associating that groups to the relavent content.
    Beacuse of this change I am not not able to read the non public content. The call to DOC_INFO_BY_NAME service, which gives all the content files' metadata, is expecting the user to be logged in to give the details.
    I tried calling the CHECKIN service with sysadmin and captured the cookies returned by that service and use cookies for the DOC_INFO_BY_NAME service call. But the service call was faling. It is throing the 401 forbidden error with the message that user needs to be logged in to get the details.
    How to address this problem. Someone please help.
    Note: I also tried using ridc for this. I was able to get it working but since it is executing in the context of server ridc api is changing server's environment properties like HTTP_HOST, HTTP_CGIPATHROOT etc. It also seemed like system was becoming non functional after using ridc. When I called check-in the system metadata values like security group are no more loading. Not sure if ridc is the culprit here but worried that it might be causing this issue.
    Regards,
    Pratap

    Sorry, I posted too much details while posting this question. I was saying "not able to read *non* public content".
    Anyway, I was able to resolve the issue. I was able to authenticate with sysadmin credentials in the request to service using basic authentication and was able to read doc info with that credential.
    But I realized there is more than option for reading secure content.
    - I could set user name as sysadmin in the m_environment (if I am in the context of a service) and the call the DOC_INFO_BY_NAME service.
    - I can post an HTTP request to DOC_INFO_BY_NAME service with sysadmin credentials and do basic authorization via the connection. (This is what i have done successfully as of now )
    - I could add guest role to all security groups with R (read) privileges.
    I will look into all options and implement the one which is more apt.
    Regards,
    Pratap

  • How to read the content of a text file (by character)?

    Guys,
    Good day!
    I'm back just need again your help. Is there anyone knows how to read the content of a text file not by line but by character.
    Please help me. Thank you so much in advance.
    Jojo

    http://java.sun.com/javase/6/docs/api/index.html
    package java.io
    InputStream.read(): int
    Reads the next byte of data from the input stream.
    Implementation:
    InputStreamReader
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.

  • How to save the contents of a file(not a text file)

    Hi all, I want to save the contents of a file(,png file, not a text file) as a field in a class. Shall I have it as a string or byte array or something?
    I have tried saving a file in a string but there were some problems with loading the file from a different platform. Following is my code.
            String string;
            try {
                StringBuffer sb = new StringBuffer(1024);
                char[] characterArray = new char[1024];
                BufferedReader br = new BufferedReader(new FileReader(file));
                while(br.read(characterArray) != -1){
                    sb.append(String.valueOf(characterArray));
                br.close();
                string= sb.toString();
            } catch (IOException ex) {
                ex.printStackTrace();
            }and I use the following code to recover the string back to a stream, and save that stream back to a time later.
        ByteArrayInputStream bais = new ByteArrayInputStream(map.getBytes());I realized that because this file is not a text file, the string could cause some problems. But anyone could tell me if I should use a byte array or someting? and how?
    Any help would be appreciated!
    Cheers,
    Jing

    You should use a byte array, and the binary streams (InputStream a& OutputStream). Never use Strings and Reader/Writer if you have binary data.
    Kaj

  • WebDynpro: How to read file content?

    Hi,
    My business scenario requires:
    1, The file name is passed in through inbound plug parameter
    2, I need to read the file content and then attach it to my CRM transaction
    Please share with me how to read the file content.
    The following approaches do not fit my scenario:
    1, UI element: FileUpload
    The reason is obvious: there is only file name parameter instead of any UI interface
    2, Function Module: GUI_UPLOAD
    The reason is that dump will happen in WebDynpro environment
    Thanks & Best Regards,
    David

    HI,
    Refer these links  -
    Get content document in WD abap
    Excel File to Internal Table

  • How to read contents of more than 2 files.

    hi all
    help me.
    How to read contents of more than 2 files.
    For reading a file contents we uses normally FileInputStream
    For reading two file contents we uses normally SequenceInputStream
    But which class we have to use for reading contents of more than 2 files at a time
    thanks in advance.

    SequenceInputStream can be used for reading any number of input streams (not at once, but one after the other).
    This involves making an Enumeration that returns the input streams you want to read. Depending on what you want to do, it might be just as easy to read them one after another.
    Or consider making a Vector of your input streams and using its elements() method. Like this:(untested)Vector<InputStream> inVec = new Vector<InputStream>();
    inVec.add(new FileInputStream("foo.dat"));
    inVec.add(new FileInputStream("bar.dat"));
    inVec.add(new FileInputStream("baz.dat"));
    // later...
    SequenceInputStream in = new SequenceInputStream(inVec.elements());

  • How to read contents of a property file sequentially

    hello all,
    please can any one tell me how to read contents of a property file sequentially.
    i saw most of the classes provided by JAVA API, which get All keys and there return type is enumeration which dosent preserve , or may the getKeys() method of those classes do not preserve the sequential order.
    Kindly do let me know if anyone has done this before.
    Thanks.

    The best solution is that you redesign your program so that it does not depend on the order of the entries in the properties file.
    If you really want to stay with your design, you will have to read the properties file yourself, line by line, just like you would read any other text file, and parse the content of each line yourself.
    BufferedReader in = new BufferedReader(new FileReader("stuff.properties"));
    String line;
    while ((line = in.readLine()) != null) {
        // Parse the line, use e.g. String.split() to split it around the '='
    in.close();

  • How to read excel file in document library and store excel content in sql table

    Hello,
    Can anyone help me how to read the excel file present in document library and store the content inside excel into sql table?
    Please let me know the ways to acheive this. Feel free to give your suggestions.
    Thanks,
    Cool Developer

    Hi!
    this code i have written becuase i donot find any soltions on net for this , u can try with this . :)
    System.Data.OleDb.
    OleDbConnection ExcelConnection = null;
    FileMode fileMode;
    string filePath = ConfigurationManager.AppSettings["TempLoaction"] + "\\" + fileName;
    using (SPSite _site = new SPSite(SPContext.Current.Web.Url))
    using (SPWeb _web = _site.OpenWeb())
    string docLibrary = ConfigurationManager.AppSettings["DocumentLibrary"];
    SPFile _file = _web.GetFile("/" + docLibrary + "/" + fileName);
    fileMode =
    FileMode.Create;
    byte[] byteArray = _file.OpenBinary();
    MemoryStream dataStream = new MemoryStream(byteArray);
    Stream stream = dataStream;
    using (FileStream fs = File.Open(filePath, fileMode))
    byte[] buffer = new byte[4096];
    int bytesRead;
    while ((bytesRead = stream.Read(buffer, 0, buffer.Length)) != 0)
    fs.Write(buffer, 0, bytesRead);
    fs.Close();
    //Create the Connection String
    try
    string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;
    Data Source ='"
    + filePath + "'; Extended Properties=Excel 5.0";
    //Create the connection
    ExcelConnection =
    new System.Data.OleDb.OleDbConnection(ConnectionString);
    //create a string for the query
    string ExcelQuery;
    //Sheet1 is the sheet name
    //create the query:
    //read columns from the Excel file
    ExcelQuery =
    "Select * from [Sheet1$]"; // from Sheet1";
    //use "Select * ... " to select the entire sheet
    //create the command
    System.Data.OleDb.
    OleDbCommand ExcelCommand = new System.Data.OleDb.OleDbCommand(ExcelQuery, ExcelConnection);
    //Open the connection
    ExcelConnection.Open();
    //Create a reader
    System.Data.OleDb.
    OleDbDataReader ExcelReader;
    ExcelReader = ExcelCommand.ExecuteReader();
    //For each row after the first
    while (ExcelReader.Read())
    thanks,
    kshitij

  • How to read the contents of attached files

    Hi,
    I am designing a Form using LiveCycle Designer 8.0
    Scenario:
    User can attach the file through "Attachments" facility provided on Adobe  Reader.
    The requirement is to attach 3 documents and post it to SAP system using Web services.
    I am using the following code(which i got from this forum only) to find the number of files user has attached.
    d = event.target.dataObjects;
    n =  d.length;
    xfa.host.messageBox("Number  of Attachments: "+n);
    //Displaying  the names of the Attached files
    for( i =  0; i < n; i++ )
    xfa.host.messageBox("Name  of the file: "+d[i].name);
    My problem: is how to read the contents of the attached files so that I post it to SAP using Web services
    Thanks in advance!!
    Taha Ahmed

    In order to read the content of the Redo Log files, you should use Logminer Utility
    Please refer to the documentation for more information:
    [Using LogMiner to Analyze Redo Log Files|http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/logminer.htm#SUTIL019]
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • How to read some records from a text file into java(not all records)

    hello,
    how to read text files into java. i need only few records from the text file not all records at a time.
    If any one knows plz reply me
    my id is [email protected]

    this snipet reads a text file line by line from line 1 to 3
    try {
                  FileReader fr = new FileReader(directory);
                  BufferedReader br = new BufferedReader(fr);
                  int counter = 0;
                  while ((dbconn = br.readLine()) != null) {
                      switch(counter){
                          case 0:
                            status = dbconn;
                          break;
                          case 1:
                            userName = dbconn;
                          break;
                          case 2:
                            apword = dbconn;
                          break;
                      counter++;
                  br.close();
        }catch(IOException e){
        }

  • Help on how to read the content of an XML file from the payload

    I have a receiver channel / mail adapter, that sends e-mails with a XML attachment.
    I’m trying to write a Bean, that should make it possible to rename the attached XML file dynamically.
    In the Bean I want to read the content of the attached XML file, it could be the “order number”.
    The filename should then be “Order number”.XML.
    <u><i>Can anyone help me with how to read the content of the XML file from the payload.</i></u>
    <i><b>Frank</b></i>

    hi,
    check this: http://jakarta.apache.org/poi/

Maybe you are looking for

  • Mac Pro has strange display problems

    Hello, i have a strange problem with my new Mac Pro. since maybe 1 week the 2 TFT Displays, connected to the nvidia Geforce 7300 GT went black for 2-5 seconds. The 2 Screens display "No signal" during that time. Is there a way to test my GFX Card ? a

  • Why does it take so long to download the Epson driver update?

    App Store asked me to update my Epson printer software to 2.15.1 and I clicked OK... That was over an hour ago and it's not even at 3.6MB of the 39.7MB!!! It's giving me that crap about "7 hours and 3 minutes remaining". What's interesting is that ju

  • Designer 6i + 9i: Java tools (Version History etc) do not work in 9i

    1. I have installed both Designer 6i (4.2) and 9i in different homes. 6i works fine, but in the 9i installation the java tools, such as Version History Viewer etc. do not work. The java classes cannot be found. Any suggestions? 2. 6i R4.2 and 9i seem

  • ODI Invoke Web Service XML Request error.

    hi, i want to invoke a web service from ODI 10g. i use OdıInvokeWebService in package. in General tab. I wrote the parameters values. when i execute package it gives error; com.sunopsis.wsinvocation.SnpsWSInvocationException: Part does not exist:Head

  • Feels like an alpha release

    Looked forward to using safari, unexpected release for windows. One of my main concerns about switching to osx was that some sites might not work with this as majority of sites are developed for IEx only. I like the look and feel of the UI, very eleg