File dir in jdev

hi all
i have an .xml file in my adf application .
it located at view--->backing----->myfile.xml i try to read som data from it but always i get exception file not found ,
so how to refer to the file location in this case.
thnx

Try the following statement to get an InputStream to your file:
InputStream stream = MyClass.class.getResourceAsStream("/view/backing/myfile.xml");where MyClass is some application class that is packed in the same JAR or WAR as the requested XML file.
This approach should work when the application is run inside JDeveloper as well when the application is deployed on a standalone application server.
Dimitar

Similar Messages

  • Reading file from a folder : File dir = new File(URL+aFile_to_add);

    Hi,
    Trying to read files from a dir on my site using a JSP and bean. I've tried nearly every option for the filepath I can think of and it doesn't seem to be finding the file...
    Here's the bit:
    String URL = "images\\wedding_photos\\";
    File dir = new File(URL+aFile_to_add);
    String[] files = dir.list();
    It's working locally, but I obviously had to change the path from c://... to the above.
    The full code is listed below in the addWedding Method
    The method removes the .jpg from the file name and then writes the new file name to a database
    Thanks for any insight.
    Regards
    Jim
    public String addWedding(String aFile_to_add)
    String feedback = "unset in scrubWedding";
    try
    String URL = "images\\wedding_photos\\";
    Class.forName("org.gjt.mm.mysql.Driver");
    java.sql.Connection connection = java.sql.DriverManager.getConnection("jdbc:mysql://localhost/rhwedd2_shop?user=**********&password=*******");
    java.sql.Statement statement = connection.createStatement();
    File dir = new File(URL+aFile_to_add);
    String[] files = dir.list();
    if (files == null)
    feedback = "Sorry, couldn't find the file "+aFile_to_add+"...no files have been added.";
    else
    for (int i=0; i<files.length; i++)
    // Get filename of file or directory
    String filename = files;
    String no_extension;
    //convert string array element into a char array
    char [] charsfilename = filename.toCharArray();
    int newlength = charsfilename.length -4;
    no_extension = String.valueOf(charsfilename,0,newlength);
    filesAdded = filesAdded+", "+no_extension;
    // Show the new file names in stack trace without extension
    //System.out.println("String no_extension " + no_extension );
    statement.executeUpdate("INSERT INTO items VALUES ('"+no_extension+"',5,'"+aFile_to_add+"')");
    // write to table with item_id and weddingid
    feedback = "The following files have been added..."+filesAdded;
    if (statement != null )
    statement.close();
    if ( connection != null )
    connection.close();
    catch(Exception e)
    feedback = "Into the catch";
    e.printStackTrace(System.err) ;
    return feedback;
    }//end addWedding

    String URL = "images\\wedding_photos\\";
    File dir = new File(URL+aFile_to_add); ok, ok, I'll answer...
    1) What gives you the impression that the relative directory "images\\..." exists (or, in other words, what makes you think your current directory is the parent of "images"?

  • Can't Find File/Dir info  Error 3 :: 30 and (-43)

    Please help me with this issue. There's very little previous mention anywhere about this sort of problem.
    I'm trying to open an After Effects file that I haven't opened in a while, and the footage I used in the project has since been deleted. When I click it to open it it gives me the message:
    After Effects Error: finding file/dir info for file "C://user// yada yada yada....Segment2.aep" file not found (-43) 
    3 :: 30
    All my plugins are still intact and I've tried everything mentioned on the one other thread about 3::30 (which only contained one suggestion).
    I really need to access this file as I did a lot of work in there that I can use again and save days of work, even though the footage the file used is gone.
    Thank you in advance!
    -Raphi

    Oh, well it looked from your initial description that you had possibly imported an After Effects project into another After Effects project.
    That being said, you may want to try the very same thing to see if you can salvage you seemingly corrupt project file. Try to create a brand new After Effects project, and import the file that you're trying to open (Segment2.aep) into the new project. If the file isn't corrupted, it should import.
    Aside from that, if you have a backup of your old project, I'd suggest trying to restore it.

  • Crackling sound on file/dir copy/move

    I've noticed for several months that when I copy/move files/dirs I get a distinct short 'crackling' or static sound. Very short (under 1 second) but loud and piercing. What associates a sound with an action (like copy/move)?
    Anyone else?
    iMac Mac OS X (10.4.9)

    I've noticed for several months that when I copy/move
    files/dirs I get a distinct short 'crackling' or
    static sound. Very short (under 1 second) but loud
    and piercing. What associates a sound with an action
    (like copy/move)?
    System Preferences > Sound > Sound Effects: the “Play user interface sound effects” checkbox.
    Dual-core G5 2.3 GHz   Mac OS X (10.4.9)   2.5 GiB RAM

  • Reliable file upload using JDev, AS and other

    Hello,
    I'm not sure this is the right place to post this message, sorry if I was wrong to put it here.
    The question is our company is developing software, for active data exchange with other systems. We decided to exchange in xml format, by means of both web services and web interface (so that exchange could happen both automatically and on user request). We use JDev to develop, Oracle AS to deploy application. Systems we exchange can use various platforms, in fact, it doesn't matter what exactly they use. The question is we need a reliable way to exchange large (sometimes small, but can be 1Gb or, for example, 10Gb) files, maybe with appropriate security, so that it could continue if something happens with network connection.
    One simple decision is to have a web service that accepts, for example, 100K at a time, and another service continuously calls it until file is transfered. So it can check response code. But are there better decisions? I think, there are libraries or smth like this?
    Thanks in advance, believe, it's a right place to get help.
    Valeriy

    Another, simpler (we think), such package is Jenkov HTTP Multipart File Upload. It's a servlet filter which can work in front of both servlets and JSP's. The servlet filter parses the uploaded file and stores it temporarily on the servers disk. When the servlet or JSP executes afterwards, it can obtain all the information about the file, from the request attributes. There is a decent manual for HTTP Multipart File Upload on the website.
    Just search for "Jenkov HTTP Multipart" on Google and you'll find it. HTTP Multipart is free, open source, Apache Licsense.

  • How to use the build file generated by Jdev to automate bpel deployment

    Hi everyone I am trying to deploy bpel jar files and human task ear files using ant. When i use the ant which is generated by Jdev I am gettinng an error
    C:\Documents and Settings\254876\Desktop\BPEL_ANT>ant
    Buildfile: build.xml
    deployTaskForm:
    BUILD FAILED
    C:\Documents and Settings\254876\Desktop\BPEL_ANT\build.xml:39: Could not create
    task or type of type: deployTaskForm.
    Ant could not find the task or a class this task relies upon.
    This is common and has a number of causes; the usual
    solutions are to read the manual pages then download and
    install needed JAR files, or fix the build file:
    - You have misspelt 'deployTaskForm'.
    Fix: check your spelling.
    - The task needs an external JAR file to execute
    and this is not found at the right place in the classpath.
    Fix: check the documentation for dependencies.
    Fix: declare the task.
    - The task is an Ant optional task and the JAR file and/or libraries
    implementing the functionality were not found at the time you
    yourself built your installation of Ant from the Ant sources.
    Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
    task and make sure it contains more than merely a META-INF/MANIFEST.MF.
    If all it contains is the manifest, then rebuild Ant with the needed
    libraries present in ${ant.home}/lib/optional/ , or alternatively,
    download a pre-built release version from apache.org
    - The build file was written for a later version of Ant
    Fix: upgrade to at least the latest release version of Ant
    - The task is not an Ant core or optional task
    and needs to be declared using <taskdef>.
    - You are attempting to use a task defined using
    <presetdef> or <macrodef> but have spelt wrong or not
    defined it at the point of use
    Remember that for JAR files to be visible to Ant tasks implemented
    in ANT_HOME/lib, the files must be in the same directory or on the
    classpath
    Please neither file bug reports on this problem, nor email the
    Ant mailing lists, until all of these causes have been explored,
    as this is not an Ant bug.

    Ensure JDEV and SOA versions are in sync.

  • A simple python3 mass file/dir renamer for the cli

    Hi fellow archers!
    I released a simple script for mass file/renaming of files; it provides some interesting feature (incremental numbering, name cleaning, use parent dir name, replace patterns) and can be used together with ranger file manager to apply it to selection.
    Check it out on github!
    https://github.com/andya9/pyrenamer/tree/master
    (I tested it a lot and use it nearly daily on important file; but as always, try it safely first! an option to only *show* expected output is provided)

    I resolved this issue. For some reason JDeveloper did not reconize the build.xml file as a valid ant build file until I closed it and re-started it.
    Thanks!
    etnot

  • How to use Connection Pool in ADF ear file creaion from jDev 10.1.3

    Hi,
    We are developing big application in ADF with 10 different modules. We are creating ear file with data source setting.
    How to use connection pool while creating ear file from jDev. Connection pool is alreday created in Application Server 10g.
    What all the setting we need do to make use of connection pool while creating ear file jDev.
    Thanks

    User,
    If you are using ADF Business Components, you can right-click each application module, select "configurations" and edit the configuration you are using. On the initial page of the configuration dialog, you can specify to use either a JDBC URL or a Datasource - you just need to choose Datasource and then provide the name by which to access it.
    John

  • File & dir permissions check

    Hello again
    Is there any way to perform a easy check of essential files and dirs permissions in Linux from security point of view?
    Thank you for your attention.

    Take a look at Tiger, a security audit tool. it's in AUR.
    Last edited by rwd (2009-07-04 21:39:47)

  • Can't Execute JAR file deployed from JDev 903

    Hi Everyone:
    I took the Oracle beginning Java class, and got a copy of JDeveloper 9, and started in on a project. The task was to create a small module that will allow users with no direct SQL access to change their Oracle passwords. The good news is that it runs great from within JDev; it catches exceptions cleanly, it handles multiple databases with no problems. The bad news is that I cannot get it to run from a batch file or command line (client is Windows). I have run 'setvars', I have copied the CLASSPATH from the run window in JDev, all to no avail.
    I am trying to deploy the app as an executable jar file. It's not meant to be an applet, because of the security implications.
    I would gladly RTFM, but the FM's that I have gloss over the deployment step in Jdev. I figure it's something obvious, but I just cannot figure it out.
    Any suggestions? Help a newbie...
    Thanks,
    Mike

    Hi Mike,
    I suggest you take a look at the log window of JDev, when you've successfully run your project.
    If the log window is not displayed, go to View | Log.
    Cut the command line, invoking javaw.exe, and paste it into your favorite editor.
    Change javaw.exe into java.exe, save your file as a bat file, go in a DOS console, and run the bat file.
    Let me know if it fixes your problem.
    Thanks,
    - Olivier

  • Can Flash MX 2004  handle Director files (.dir)

    Hi,
    Can Flash handle Director movies? I am making a presentation
    of my artworks in Flash environment; I have both Flash and Director
    movies. I know that I can import all my swf movies into Director
    MX2004 to create a standalone projector and play both swf and dir
    movies in Director MX 2004. Does the same work if I import dir
    files into Flash MX 2004 Pro?
    Thanks
    Uti

    uxk8396 wrote:
    > What will be the ideal solution in this case. I do not
    have Director MX 2004.
    > I have only Macromedia Studio mX 2004 Pro.
    Hi Uttam,
    If you need Director movies to be integrated with Flash
    movies, there is only one
    way, use Director. If you don't have Director, then you won't
    be able to use the
    Director movies. So, either, recreate the Director movies in
    Flash (if it's
    possible), or better yet, get Director
    regards
    Dean
    Director Lecturer / Consultant
    http://www.fbe.unsw.edu.au/learning/director
    http://www.multimediacreative.com.au

  • Can't open up file adapter in JDev

    Hi,
    I have installed the file adapter sample adapters-file-101-FlatStructure from here
    https://java.net/projects/oraclesoasuite11g/pages/FileAdapters
    deployed, ran.
    I want to open either read or write file adapter in JDeveloper but when I double click on it or right click/choose 'Edit' nothing happens. Why?
    Thank you

    Karan,
    No problem with database adapter or BPEL processes, they open up fine. So far only file adapter give me trouble.
    Thank you
    A
    PS Not sure if this make a difference - in my jca file (FlatStructureIn_file.jca) the second line which is <?binding.jca FlatStructureIn_file.jca?> is in GREY color (all of it).
    All other lines are "normal" with "usual" color scheme, not sure if this can be seen from below
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <?binding.jca FlatStructureIn_file.jca?> ------------------------------(this is the GREY color line)
    <definitions name="FlatStructureIn" targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/FlatStructureIn/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/file/FlatStructureIn/" xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:imp1="http://xmlns.oracle.com/pcbpel/demoSchema/csv">
        <documentation>Flat Structure Inbound File Adapter</documentation>
        <types>....
    PS2
    Karan, I downloaded / installed another sample today from
    http://technology.amis.nl/wp-content/uploads/images/ProductCatalog.zip
    No problem opening file adapter here, could you have a look at the wsdl, the file doesn't have ....jca line though, the wsdl looks like this:
    <wsdl:definitions
         name="ScanCatalogFile"
         targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/ProductCatalog/ProductCatalog/ScanCatalogFile"
         xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
         xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/file/ProductCatalog/ProductCatalog/ScanCatalogFile"
         xmlns:imp1="http://myshop.com/ScanCatalogFile"
         xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
        >
      <plt:partnerLinkType name="ScanProducts_plt" >
        <plt:role name="ScanProducts_role" >
          <plt:portType name="tns:ScanProducts_ptt" />
        </plt:role>
      </plt:partnerLinkType>
        <wsdl:types>
          <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/ProductCatalog/ProductCatalog/ScanCatalogFile"
                  xmlns="http://www.w3.org/2001/XMLSchema" >
            <import namespace="http://myshop.com/ScanCatalogFile" schemaLocation="xsd/SampleProductCatalog_1.xsd" />
          <element name="empty"><complexType/></element>
          </schema>
        </wsdl:types>
        <wsdl:message name="Empty_msg">
            <wsdl:part name="Empty" element="tns:empty"/>
        </wsdl:message>
        <wsdl:message name="ScanProducts_msg">
            <wsdl:part name="body" element="imp1:Catalog"/>
        </wsdl:message>
        <wsdl:portType name="ScanProducts_ptt">
            <wsdl:operation name="ScanProducts">
                <wsdl:input message="tns:Empty_msg"/>
                <wsdl:output message="tns:ScanProducts_msg"/>
            </wsdl:operation>
        </wsdl:portType>
    </wsdl:definitions>
    and the jca file looks like this:
    <adapter-config name="ScanCatalogFile" adapter="File Adapter" wsdlLocation="ScanCatalogFile.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
        <connection-factory location="eis/FileAdapter"/>
      <endpoint-interaction portType="ScanProducts_ptt" operation="ScanProducts">
        <interaction-spec className="oracle.tip.adapter.file.outbound.FileReadInteractionSpec">
          <property name="DeleteFile" value="false"/>
          <property name="PhysicalDirectory" value="d:\temp\products"/>
          <property name="FileName" value="ProductCatalog.txt"/>
        </interaction-spec>
      </endpoint-interaction>
    </adapter-config>

  • File Categorization in JDev 10g

    what ever happended to all the wonderfull categories, like ejb, deployment etc. all this stuff has been placed under resources. Plus how about a directory view in the database category, once we manage to put it back inside the IDE. One more thing WYSIWYG in JSP is nice but I would like to go into the code editor by default how can I get about doing this in Oracle 10g.

    Hi Christopher,
    The old system navigator is still available in all its categorized glory (View->System Navigator) :)
    Brian
    JDev Team

  • Creating a tree structure like Windows file explorer using Jdev

    Hi All,
    Is it possible to develop a tree structure like windows in JDEV and then same page I want to move to oracle apps.
    This tree I am creating for Showing Employee information. Like Parents & childs under it. i.e. Managers and employee reporting to managers.
    Please let me know if it is possible, if yes how , what is method of doing this.
    Thanks
    Ganesh Mane

    Yes. This possible with ADF Faces RC, which provides an af:tree component. Have a look at the Fusion Order Demo, which uses the tree to implement a similar usecase to the one you describe.
    http://www.oracle.com/technology/products/jdev/samples/fod/index.html
    Regards,
    RiC

  • What system files/dirs do you back up?

    I just took a look at some of my backup scripts that I wrote not too long after switching to Linux. I realized that I'd included some things which are probably useless but I'm not sure about some others, so I'd like to know what others back up and why.
    I'm fairly sure that all of /etc is worth backing up but I don't know about /var. I compress the local database and save that but I see no reason to save the sync database. I see no reason to back up the package cache either unless I'm using an old version of something. What else is worth backing up in /var? What about the rest of /?
    What do you back up outside of /home?

    Blue Peppers wrote:
    Xyne wrote:@Blue Peppers
    It seems like a waste of time to reconfigure everything that stores files in /etc (vsftp, apache, ssh, etc). I also wouldn't want to reinstall everything due to a single partition failing, whether or not the initial installation is relatively fast.
    How often does your root partition fail? It happens rarely enough for me, that I don't mind reconfiguring everything over again. I see it as a opportunity to learn, and if it takes longer than half an hour, then so be it. It's no inconvenience to me, and it needn't be to most people. I have a list of apps that I need, ~/.config files for them and no strange configureations anywhere else.
    Back when I had just started linux, I was reinstalling (minus backups) every 2 weeks or so. I didn't have a clue, but by re-working those lost configuration files, I learnt how they worked. As I still don't feel I know enough about archlinux, I see losing the files as, while not being a good thing, not a bad thing.
    /etc is like 30MB for me...no reason not to back it up. As mentioned, there are many config files that would be a pain to reconfigure. Plus, I don't see how you would "learn" how they work, after already taking the time to configure them in the first place. I really don't wanna reconfigure all those, especially all my web server stuff. Doesn't make much sense.

Maybe you are looking for

  • Project Upgraded from xcode 3.2 to xcode 4.5 give semantic errors

    I upgraded my project from xcode 3.2 to xcode 4.5 My code is platform independent and it compiles sucessfully on Windows and Linux with out any errors But on Mac 10.7.4 and xcode 4.5 it gives semantic errors - "Explicit specialization has extraneous,

  • Webdynpro Version Q & A

    Hello expert I am new to webdynpro and please assist me. 1. How I want to check the version of webdynpro? 2. How I want to determine whether the webdynpro is in abap or java? Thanks! A. Joker.

  • How to make a file "hidden"

    This question might sound stupid but here it goes. How do you hide a file?, i know how to view hidden files (onyx) but i dont know how to make a normal file as hidden

  • Pseudo code

    Hi, i have never done ArrayList, and we just happened to get this big final homework, what do we look like?? anyways, could you guys help me out to create the algorithm for this?? I.     The Problem A banking institution offers certificates of deposi

  • Active desktop?

    Active desktop? I think that's what they called it in Windows. Does anyone know how I can set a desktop image that moves? I know how to go through preferences and choose a file. But I found a little GIF on the internet, a little face with bliking eye