Again: UDF: Load file from "imported archives"

Hi everybody,
I tried to read a txt-File from the "imported archives".
The following does not work:
try {
+     FileInputStream fstream = new FileInputStream(Filename);+
+     DataInputStream in = new DataInputStream(fstream);+
+     BufferedReader br = new BufferedReader(new InputStreamReader(in));+
} catch (Exception e) {// Catch exception if any
+     return "Error: " + e.getMessage();+
}//catch
return "test";
I get the error:
abc.txt (No such file or directory)
Any ideas?
regards Mario

Hi roberti,
it is possible!
I found some coding that works:
     String returnString="";
     byte[] buffer;
     try {
          InputStream is = this.getClass().getClassLoader().getResourceAsStream(filename);
          buffer = new byte [is.available()];
          is.read (buffer);
          returnString = new String (buffer, "ISO-8859-1");
     catch (Exception e) {
          returnString = e.getMessage();
     return returnString;
Unfortunately this coding gets the whole file in once. But I need the single lines.
Thats why I tried to use FileInputStream instead on InputStream
Any idea?
Regards Mario

Similar Messages

  • UDF: Load file from "imported archives"

    Hi everybody,
    I need some code for loading a file from the imported archive. I can't find any blog.
    Regards Mario

    >>loading a file from the imported archive
    I dint get this. What does the imported archive contain? A java class? If so, you can acess the members of the class in the UDF with the correct package name.
    Regards,
    Jai Shankar

  • Issue in .class file in imported archive ESR - after upload using eclipse

    Dear Friends,
    My requirement here is too change existing java mapping. Here I am exporting zip file from imported archive and after making changes in eclipse upload the .JAR file again. Here .class file is not opening after upload in Imported Archive.
    Error is
    Setup I am having on my system.
    -> JDK version on my system JDK 1.6_34
    -> JRE on my system – JRE 6
    -> Using eclipse SDK 4.2.2
    SAP PI servers settings.
    I searched online blogs but no help. Can anybody guide me what wrong am I doing here?
    Thanks.
    Sumeet.

    Thanks for reply..Hareesh.
    -> In Eclipse only 1 warning is coming and no error. I guess Eclipse automatically compile .class file. Is there any way in eclipse to see if compilation is done properly?
    -> I imported few external JAR files and already few JAR files are there in Eclipse(JRE1.6), as shown in fig below. Which JAR file is being user? How can I make sure?
    -> When using Run as option I am not getting any option. Is it normal or did I have to activate some option?
    Please give your views on this.
    Thanks.
    Sumeet.

  • Import files from internet archive

    Please help, in plain english, how can I import grateful dead shared files from internet archive into itunes so I can load some awesome Dead shows onto my ipod? I have one ready here- it's a zipped MP3 file full of tunes... what next?
      Windows XP  

    it's a zipped MP3 file full of tunes
    old head,
    More likely it is a zipped folder full of mp3s. Correct? If so, and if it is on your hard drive, double-click it, and when the dialog comes up, click on "Extract all Files." Follow the onscreen steps and you will end up with a regular folder full of mp3s. Put the folder wherever you want it on your hard drive.
    Then in iTunes, use the File > Add Folder to Library command, point it to your new folder, and the songs will add to your library.
    Once you've confirmed that everything worked, you can delete the original zip folder.
    If anything looks different at any step, pls post again. Otherwise, enjoy the trip.
    Ed
    Windows XP & 30GB iPod

  • UDF to copy the file from the archive folder to the source folder

    HI,
    I need a UDF to copy the xml file from the archive folder to the source folder. I dont want to create a new comm channel
    Regards,
    Varun
    Edited by: Varun Reddy on Sep 15, 2009 11:23 AM

    Hi Varun,
    do you want to copy or move the files??
    Also can you explain the time when this movement should happen? this gives a little insight on the problem and also some optimum solutions can be suggested
    Regards
    Suraj

  • How to extract iMovie files from an archived iDVD project

    Hi,
    After archiving an iDVD project which contained several individual iMovies to my back up hard disk I deleted all of the individual files on my internal HD to free some space.
    Query: Is it possible to extract an individual iMovie file from the archived project for future editing revealing all of the transitions, audio tracks, etc back in iMovie ?
    I have used 'show package contents' and can see the individual movies as Quick Time files but when I load these into iMovie all I get is the whole movie as one single clip.
    I suspect the answer is once it's archived I cannot retrieve the iMovie files ?
    Any help appreciated. Many thanks.
    iMac G5 20" 2.0GHz 1Gb RAM   Mac OS X (10.4.4)   eMac 1GHz 512Mb RAM

    ...I ..can see the individual movies as Quick Time files but when I load these into iMovie all I get is the whole movie as one single clip. I suspect the answer is once it's archived I cannot retrieve the iMovie files ?
    that is correct: hitting "export" or share in iM creates a single movie(file); what you have in mind is the imovie project (e.g. where you can change titles, transitions etc)... to make this accessible you need to backup that iM folder/package (the one with a star)... these files are for sure much bigger = containing more data...

  • Batch file extracting all files from nested archives

    I have managed to leverage a powerful
    forfiles command line utility with the mighty
    7z compression program.
    Below is a simple batch file extracting all files from nested archives hidden at any depth inside other archives and/or folders. After the extraction each archive file turns into a folder having the archive file name. If, for example, there was an "outer.rar"
    archive file containing nothing but an "inner.zip" archive with only "afile.txt" inside, "outer.rar" becomes "...\outer.rar\inner.zip\afile.txt" file system path.
    @echo off
    rem extract_nested_archives.bat
    move %1 "%TMP%"\%2
    md %2
    7z x -o%1 -y %TMP%\%2
    del "%TMP%"\%2
    for %%a in (zip rar jar z bz2 gz gzip tgz tar lha iso wim cab rpm deb) do forfiles /P %1 /S /M *.%%a /C "cmd /c if @isdir==FALSE extract_nested_archives.bat @path @file"
    ARCHIVES ARE DELETED DURING THE EXTRACTION! Make a copy before running the script!
    "7z.exe" and "extract_nested_archives.bat" should be in folders available via the %PATH% environment variable.
    The first parameter of extract_nested_archives.bat is the full path name of the archive or folder that should be fully expanded; the second parameter is just the archive or folder name without the path. So you should run "c:\temp\extract_nested_archives.bat
    c:\temp\outer.rar outer.rar" from the command line to completely expand "outer.rar". "c:\temp" must be the current folder.
    Best regards, 0x000000AF

    Incredibly useful!  Thank you so much.  I did make a couple of small changes to make the script a little easier to use from the end-user perspective.
    First - I don't like making the user input the redundant second parameter, so I added this snippet which extracts it from the first parameter.  The first line of the snippet enables delayed expansion so that special characters in our file name don't
    break anything.  The second line pulls the parameter into a variable, and the 3rd line uses delayed expansion on that new variable.  Before implementing delayed expansion I had problems with file paths which included parentheses.
    SetLocal EnableDelayedExpansion
    Set SOURCE=%1
    For %%Z in (!source!) do (
    set FILENAME=%%~nxZ
    set FILENAME=%FILENAME:"=%
    Anyway once that was done, I just used %FILENAME% everywhere in the script instead of
    %2 (making sure to correct quotes as needed)
    This way, to run my script all you need to run is:
    C:\temp\extract_nested_archives.bat C:\temp\Archive.zip
    Second - I didn't want to modify the Windows environment variable.  So I replaced
    7z with "%PROGRAMFILES%\7-zip\7z.exe"
    I also replaced extract_nested_archives.bat with "%~f0" (which represents the full path+filename of the current script).
    Here is my full script now.  Tested on Windows 8 with the 64-bit version of 7-zip installed:
    @echo off
    Setlocal EnableDelayedExpansion
    Set source=%1
    For %%Z in (!source!) do (
    set FILENAME=%%~nxZ
    set FILENAME=%FILENAME:"=%
    move /Y %1 "%TMP%\%FILENAME%"
    md "%FILENAME%"
    "%PROGRAMFILES%\7-zip\7z.exe" x -o%1 -y "%TMP%\%FILENAME%"
    DEL "%TMP%\%FILENAME%"
    for %%a in (zip rar jar z bz2 gz gzip tgz tar lha iso wim cab rpm deb) do (
    forfiles /P %1 /S /M *.%%a /C "cmd /c if @isdir==FALSE "%~f0" @path @file"

  • Program/T-Code to load files from local system to XI system's tmp folder

    Dear all,
    Do we have any program or transaction to load files from our local system to the usr/tmp folder of XI system.
    Please share the info, if anyone has already faced the similar requirement.
    regards,
    Younus

    1) goto SXDA_TOOLS Transaction code
    2) Provide the Following details
    Object Type : DXPROJECT
    Program Type: BAPI
    Program/Method: CREATE
    3) Click on Copy Button
    4) Select the Source as Presentation Server
    a) Select the File where you saved in your Local machine
    5) Select the Target as Application server
    a) Check the check box Remote Server
    b) Select the File type as Physical
    c) In File name give /usr/sap/SSD/DVEBMGS00/work\Your file name (This the Server path
    Where the file is going to save)
    6) Click on Continue
    Go to AL11 and check whether the File has been create in the following path /usr/sap/SSD/DVEBMGS00/work
    Provide this path in the Communication channel path when you select the Transport Protocol as NFS and you place the file in AL11 directory.

  • How do I suppress messages/loading bars from Import-Module and Import-PSSession?

    Hello,
    How do I suppress messages/loading bars from Import-Module and Import-PSSession?
    I am writing a script that will be using these commands and it makes the script look clunky/scary to novice users.
    Thank you for your time.

    Sorry to bring this back up, but it seems that the ProgressPreference worked for Exchange, but it didn't affect the Active Directory progress bar. Any ideas why?
    Strange, this worked just fine for me (no module loading indication):
    PS C:\Users\mike.admin> $ProgressPreference = 'SilentlyContinue'
    PS C:\Users\mike.admin> Get-ADUser mike.admin | Select Name
    Name
    mike.admin
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)
    I do run the Import-Module command inside a function, but I doubt that would do it because I assume the preference is set scriptwide.
    This will work anywhere.
    $global:ProgressPreference='SilentlyContinue'
    ¯\_(ツ)_/¯

  • Accessing a file in Imported Archive from Adapter module

    Hi,
    I am designing a module for File/FTP and Mail adapters. Is it possible to retrieve data from a CSV or TXT file uploaded in the Imported Archive from the Java code in the module? If this is possible, do I use the same approach as accessing the CSV data from the mapping using a UDF? If this is not possible, can you suggest other ways were I can access a CSV or TXT configuration file from an adapter module?
    I would like to avoid using Module key, Parameter name and Parameter value as I would like to make the adapter module generic and the data I will be reading might be too much to be specified in this location. However, I would use the Module key, Parameter name and Parameter value to specify the CSV or TXT filename which the adapter module will be using.
    Thanks in advance for any help that you can provide.
    Regards,
    Elbert

    Imported archives are part of mapping flow and adapter modules are more part of routing. Therefore I don't think imported archive could  be made accessible anywhere outside mapping.
    but my CSV or TXT file would be updated regularly by the developer.
    So were you planning to import this file again and again under imported archive? This doesn't seems to be a good solution when you think about changin Design part in Production environment. It would be better to give access to certain folder to developer to put the file there and access it using some code. You may refer this
    /people/sundararamaprasad.subbaraman/blog/2005/12/09/making-csv-file-lookup-possible-in-sap-xi
    Regards,
    Prateek

  • Is it ok to make changes to import map by loading files from port manually?

    Hi all,
    I want to load the files from the port which is set to manual and then want to create/modify existing maps already assigned to ports.Is it ok to do this way or do we need to create the import maps with all mappings manually other than port option?
    Thanks

    Hi Arvind,
    You can load the map through port & do changes whatever you want. You can see the map name
    on the header. After making changes if you want the old map also then you need to save it in a different name.
    Regards,
    Pramod

  • Loading file from jar in webstart 1.5.0_16

    Hello all,
    We have recently updated form 1.5.0_15 to 1.5.0_16. Since the update, our application is bombing when it attempts to read an xml file from a jar in cache.
    JDOModin.xml.XMLFileReaderError in building: C:\Documents and Settings\dave.frank\Desktop\jar:lookups\version.xml (The filename, directory name, or volume label syntax is incorrect)
    org.jdom.JDOMException: Error in building: C:\Documents and Settings\dave.frank\Desktop\jar:lookups\version.xml (The filename, directory name, or volume label syntax is incorrect)
         at org.jdom.input.SAXBuilder.build(SAXBuilder.java:306)
         at org.jdom.input.SAXBuilder.build(SAXBuilder.java:617)
         at odin.xml.XMLFileReader.readFile(XMLFileReader.java:53)
         at odin.xml.XMLFileReader.<init>(XMLFileReader.java:40)
    Clearly the path to the jar file is incorrect.
    The url is retrieved like this:
    private URL getURL(String filePath)
            URL url = getClass().getResource(filePath); // relative path "/lookups/version.xml"
            return url;
    } This worked fine in the previous version. Any help would be much appreciated.

    Hi Andrew,
    We are having huge problems fixing this, and have spent quite a while searching the forums for info about it. The closest I've got is two posts where you mention that there are other posts. I can't find them.... Bloody annoying that Sun hasn't updated the webstart FAQ to tell people how to get around this very annoying problem.
    By the way, if you google 1.5.0_16, your post comes up as the second hit.
    Any pointers to threads that offer solutions to resource loading from Jars (images, auth.conf etc) when using webstart, now that it's broken in 1.5.0_16??
    Any help would be greatly appreciated!
    Thanks,
    Craig

  • How to load files from old external hard drive to new PC

    Copied files from old PC (Windows XP) to external hard drive. Purchased new PC (Windows 7). Paid technicians to transfer files from old PC to new PC. Some files were lost in the process.
    Please walk me through (step by step) on how to load spicific files from an external hard drive onto my new PC.
    Thanx, rp1

    Click anywhere on the open desktop so that the Finder menus are displayed at the top of the screen.
    Click Go > Network
    Double click the Time Capsule icon, then double click the icon representing the drive to mount it on the Mac's desktop. It is named "Data" unless you have changed it
    You can drag/drop files to the "Data" icon on the desktop
    235 GB is going to take forever if you try to do this using wireless. If at all possible, connect an Ethernet cable from your Mac to one of the LAN <-> ports on the Time Capsule.
    Even using Ethernet, you are probably looking at 10-12 hours for the file transfer.  All bets are off with wireless only, but a guess would be several days....or even more.

  • Load files from bridge into photoshop lagers

    I am trying without success to load (two) files from bridge to Photoshop as layers.

    I am not exactly sure what you are asking, but I know you can create stacks in Bridge by simply selecting the desired files and pressing ctrl G on the PC (command G on MAC?) I believe there is a forum dedicated to Bridge scripting. You might have better luck there.

  • Using getResource() to load file from a war

    Hi:
              I am using the method getResource() of ServletContext to load "web.xml"
              file from a webapp.
              It works fine when my web application is not packed into a war file. But
              when I pack it in a war file, I got MalformedURLException.
              Does anyone know the reason?
              Fun
              

    Thanks Mahendra, I checked my weblogic.properties, and it looks fine.
              fun
              Mahendra Dhamdhere wrote:
              > Is your deployed application name in weblogic.properties same as your
              > previously deployed web application name?
              >
              > Fun <[email protected]> wrote in message
              > news:[email protected]..
              > > Hi:
              > >
              > > I am using the method getResource() of ServletContext to load "web.xml"
              > > file from a webapp.
              > >
              > > It works fine when my web application is not packed into a war file. But
              > > when I pack it in a war file, I got MalformedURLException.
              > >
              > > Does anyone know the reason?
              > >
              > > Fun
              > >
              

Maybe you are looking for

  • Sync-Async without BPM- error(XIServer:TOO_MANY_RECEIVERS_CASE_BE)

    Hi all This is without BPM scenario. I am doing a SOAP - XI - RFC - XI - SOAP scenario(this is a sync call)......also at the same time i am writing a file onto a directory in async mode. What exactly i want is ...when i receive file from SOAP...i wan

  • Issue in Proxy to file scenario

    Hi Folks,     I'm Currently configuring a Proxy to File scenario in the SAP PI 7.0. when I'm trying to test the proxy class I can find in the SXMB_MONI that the sender service, sender interface & the sender namespace is there but the same for the rec

  • Posting Intercompany documents using program RFBIBL00

    Hi, I want to know if we can post intercompany documents using program RFBIBL00(Direct Input Method). If this is possible, please let me know how can this be achieved as I am getting an error "Cross-company code postings not defined". Thanks Harveen.

  • IPOD won't work with SYNC in my new Ford Fusion

    IPOD won't work with SYNC in my new Ford Fusion in the UBS port that is made for IPODs etc. Older model IPOD Any fixes?

  • IPad calendar on Google calendar?

    Hello - How can I view my iPad calendar on my Google calendar? When I update my calendar on my iPad, I can see them on my phone/desktop but not the other way around... Thanks in advance for the help!