How to read an XML file from embedded PAR file?

I have an XML file that has been included in the PAR file as a means of storage (instead of hosting it to a web server).  Is there a way to read this file from within a java iView?  I have tried various methods without much luck.  (I can't seem to locate the file in the portal repository like I could with htmlb's Image class.
Any thoughts?
Thanks

Hi,
try this one:
File myxmlFile = new File(portalRequest.getPrivateResourcePath(),"Path/to/my/file/after/PORTAL-INF/myfile.xml");

Similar Messages

  • How to read the EXIF metadata from a .jpg file

    hi,every one
    Photos which are captured by a digital camera, have some parameters, such as the exposure time,ISO speed rating,camera model,focal length etc.
    How to read this parameters???

    Is it listed in the IIOMetadata?
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import javax.imageio.*;
    import javax.imageio.metadata.*;
    import org.w3c.dom.*;
    public class IIOMetaDataExample {
        public static void main(String[] args) throws IOException {
            URL url = new URL("http://today.java.net/jag/bio/JagHeadshot-small.jpg");
            Iterator readers = ImageIO.getImageReadersBySuffix("jpeg");
            ImageReader reader = (ImageReader) readers.next();
            reader.setInput(ImageIO.createImageInputStream(url.openStream()));
            IIOMetadata metadata = reader.getImageMetadata(0);
            displayMetadata(metadata);
        public static void displayMetadata(IIOMetadata metadata) {
            String[] names = metadata.getMetadataFormatNames();
            for(int i=0; i<names.length; ++i) {
                System.out.println();
                System.out.println("METADATA FOR FORMAT: " + names);
    displayTree(metadata.getAsTree(names[i]), 0);
    public static void displayTree(Node node, int indent) {
    indent(indent);
    String name = node.getNodeName();
    System.out.print("<" + name);
    if (node.hasAttributes()) {
    NamedNodeMap attrs = node.getAttributes();
    for(int i=0, ub=attrs.getLength(); i<ub; ++i) {
    Node attr = attrs.item(i);
    System.out.print(" " + attr.getNodeName() + "=" + attr.getNodeValue());
    if (node.hasChildNodes()) {
    System.out.println(">");
    NodeList children = node.getChildNodes();
    for(int i=0,ub=children.getLength(); i<ub; ++i)
    displayTree(children.item(i), indent+4);
    indent(indent);
    System.out.println("</" + name +">");
    } else
    System.out.println("/>");
    static void indent(int indent) {
    for(int i=0; i<indent; ++i)
    System.out.print(' ');

  • How to read sampled data info from a "*.au"file into an array?

    I need to manipulate the sound file directly using DSP, the first step is to read sampled data from "*.au" file into an array. How can I do that? Thanks a lot!!

    There is a file I/O tutorial in the Java Tutorial (google for Java Tutorial). You can read an .au file as bytes like any binary file.
    Or if you are using the Java Sound API, google for java sound api or java audio tutorial etc etc.

  • How to read an xml file from headers

    Hi ,
    I am not getting how to read an xml file sent by client device in header to server.
    Thankx.

    There is a getHeader() in HttpServletRequest interface
    String locationURL=request.getHeader("Location");If URL of your file was set in Location attribute of header.
    Edited by: ngpgeeta on Dec 19, 2008 8:03 AM

  • How do i move a picture from one pdf-file to another already created pdf-file with adobe reader?

    How do I move a picture from one pdf-file to another, already created pdf-file, with adobe reader?

    Reader doesn't have editing capabilities.

  • Reading an xml file from a jar file

    Short question:
    Is it possible to read an xml file from a jar file when the dtd is
    placed inside the jar file? I am using jdom (SAXBuilder) and the default
    sax parser which comes with it.
    Long Question:
    I am trying to create an enterprise archive file on Weblogic 6.1. We
    have a framework that is similar to the struts framework which uses it's
    own configuration files
    I could place the dtd files outside the jar ear file and specify the
    absolute path in an environment variable in web.xml which is
    configurable through the admin console.
    But I want to avoid this step and specify a relative path within the jar
    file.
    I have tried to use a class which implements the entityresolver as well
    as try to extend the saxparser and set the entity resolver within this
    class explicitly, but I always seem to sun into problems like:
    The setEntityresolver method does not get called or there is a
    classloader problem. i.e. JDOM complains that it cannot load My custom
    parser which is part of the application
    Vijay

    Please contact the main BEA Support team [email protected]
    They will need to check with product support to determine
    the interoperatablity of Weblogic Server with these other
    products.

  • How do I remove password protection from a PDF file in Adobe Reader

    How do I remove password protection from a PDF file in Adobe Reader?

    PDF security can only be implemented or removed using Adobe Acrobat.

  • How to read a text file from a Jar file

    Hi
    How can I read a text file from a Jar file?
    Thanx in advance..

    thanx
    helloWorld it works.damn, I didn't remove it fast enough. Even if it is urgent, it is best not to mention it, telling people just makes them take longer.

  • How can I read a specific character from a text file?

    Hi All!
    I would like to read a specific character from a text file, e.g. the 2012th character in a text file with 7034 characters.
    How can I do this?
    Thanks
    Johannes

    just use the skip(long) method of the input stream that reads the text file and skip over the desired number of bytes

  • Reading in an array from a text file

    I'm trying to use a text file to load in some configuratin
    data (using actionscript 3) I have it working ok for simple stuff
    like gamename=Chess&gamescore=100 , etc... but some of the data
    needs to be in an array. Can someone please point me in the right
    direction to how I can read in an array from a text file?
    Thanks!

    the easiest way is to create a string with the (soon-to-be)
    array elements separated by a delimiter (like a double comma). read
    in your string, then use the split() method of strings to split
    your string into an array.

  • How can I access xml document from javascript whithin a JSP page

    how can I access xml document from javascript whithin a JSP page?
    I have a JSP that receives an XML document from a JavaBean, so I can access it within the entire JSP, but I need to access it from the javascript inside the JSP... and I have no idea how i can do this.
    Thanks in advance!

    The solution would only work on MS IE browsers, as other browsers do not support an XML DOM.
    It can be done, but you would be stuck with using the Microsoft broswer. If that is acceptable, I have some example code, and a book recommendation.

  • How can I find a photo from the backup file in my pc?

    How can I find a photo from the backup file in my pc?
    I have accidentally erased a photo. It happened after the backup.

    I am not aware you can extract a single photo or a single app's content from the backup, you can either restore the whole backup to your phone or not restore. If you restore your last backup to your phone then any content that is currently on your phone will be replaced with what was on it at the time that the backup was made - so if you do decide to restore, first copy off any purchases to your computer's iTunes via File > Transfer Purchases, and copy any documents/files that you've udpated on the phone since the backup.

  • How to create an XML document from a String.

    Can anyone help,
         In the Microsoft XML Document DOM there is a load function load(string) which will create an XML document, but now we are switching to Java and I do not know how to create and XML document from a string, this string �xml document� is passed to my program from a webservice and I need to read several xml elements form it in a web server.
    This string is a well formatted XML document:
    <?xml version="1.0" encoding="UTF-8"?>
    <Countries NumberOfRecords="1" LanguageID="en-us">
         <Country>
              <CountryCode>AU</CountryCode>
              <CountryName>AUSTRALIA</CountryName>
         </Country>
    </Countries>

    Thanks PC!
    I made it work using:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    factory.setIgnoringComments(true); // We want to ignore comments
    // Now use the factory to create a DOM parser
    DocumentBuilder parser = factory.newDocumentBuilder();
    //TransformThisStringBuffer is a string buffer wich contain the 'XML document (String)'
    InputStream in = new ByteArrayInputStream(TransformThisStringBuffer.toString().getBytes());
    // Parse the InputStream and build the document
    Document document = parser.parse(in);
    But which one is faster InputSource or InputStream, were would you put the "new InputSource(new StringReader(yourString))" in the above code?

  • How do I remove padlock icon from all my files?

    On one of my drives, every single file has a little padlock icon superimposed over the file icon. I recall when I did a clean install of windows 7 RC over my Vista install, I wasn't getting write access to the drive so I had to take ownership of the drive and mess with the security settings before it started working normally.
    I have to admit, I find the security settings in all versions of NT mystifying... For instance, although my account is in the administrators group, having full access to administrators never seems to work. I always have to add my individual user account and explicitly give it full access.
    In any case, I can't remember exactly what it took, but after messing around with the security settings for a while, I eventually was able to have full access to the drive and have no problems reading/writing/deleting files and folders, but there's the padlock icon still on everything.
    Can anyone explain how to get rid of it, and/or maybe point me to a good, clear, understandable guide on how to properly set NTFS permissions.
    Thanks!

    <form id="aspnetForm" action="edit" enctype="application/x-www-form-urlencoded" method="post">
    <input id="__VIEWSTATE" name="__VIEWSTATE" type="hidden" value="/wEPDwULLTEzNzk0MzkwMDlkZD6SorGRLWx4w+alHb7GRMyulXR+" />
    </form>
    Windows Client TechCenter
    <input id="SearchTextBox" class="TextBoxSearch TextBoxSearchIE7" name="SearchTextBox" type="text" /><input id="SearchButton" class="SearchButton" name="SearchButton"
    src="http://i1.social.microsoft.com/globalresources/Images/trans.gif" type="image" /> 
    Sign out
    United States (English)
    Australia (English)Brasil
    (Português)Česká republika (Čeština)Danmark
    (Dansk)Deutschland (Deutsch)España
    (Español)France (Français)Indonesia
    (Bahasa)Italia (Italiano)Magyarország
    (Magyar)România (Română)Singapore
    (English)Türkiye (Türkçe)Россия
    (Русский)ישראל (עברית)المملكة
    العربية السعودية (العربية)ไทย (ไทย)대한민국
    (한국어)中华人民共和国 (中文)台灣
    (中文)日本 (日本語)香港特別行政區
    (中文)
    ZYBORG
    Resources for IT Professionals
    HomeWindows 7Windows VistaWindows
    XPLibraryForums
    Windows Client TechCenter >
    Windows 7 IT Pro Forums
    > Windows 7 Security
    > How do I remove padlock icon from all my files?
    > a9d3326a-9af4-4d81-9f6e-0df9575b4fea
    <form action="/Forums/en/w7itprosecurity/thread/16474fcf-688b-4eae-88f4-804306bafc0f/a9d3326a-9af4-4d81-9f6e-0df9575b4fea/edit" enctype="application/x-www-form-urlencoded" method="post">
    Edit Message
    <textarea cols="100" rows="20" name="body"><blockquote> <p>Hi,</p> <p>This is a new feature of Windows 7 RC. If a folder's ownership is SYSTEM, the icon would be appears.</p> <p>To
    remove the icon, please change the ownership of the folders. You may refer the following website.</p> <p><a href="http://www.vista4beginners.com/Change-permissions-take-ownership">Change the permissions and take ownership of your
    files and folders&nbsp; Windows Vista for Beginners</a>&nbsp;</p> <p>Important Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft
    does not guarantee the accuracy of this third-party contact information.</p> <hr> Arthur Xie - MSFT</blockquote> <p>You may call this a feature but I call it rediculous. The security and ownership system deployed in win 7 is beyond
    belief and horribly BAD!</p> <p>I have files which have disappeared from view under start / all programs which are clearly on my system. They can be seen by an administrator only account but not by a users acccount which has administrator privs.
    That really makes great since!</p> &nbsp;Returning to Win XP looks like a good option to me. Anyone who changes the ownership of an entire drive is asking for latent problems when various areas within windows needs ownership of SYSTEM or Trustedinstaller
    and others which were overwritten with the change.</textarea>
    <label for="hasCode">Resource.HasCodeLabel</label><input name="hasCode" type="checkbox" value="true" /> <label for="reason">Reason</label><input name="reason" type="text"
    />
    <input title="Submit" type="submit" value="Submit" />
    </form>
    Need Help with Forums? (FAQ)
    © 2011 Microsoft. All rights reserved.
    Terms of Use|Trademarks|Privacy Statement|Contact
    Us
    <script type="text/javascript"></script> <script type="text/javascript"></script> <script type="text/javascript"></script> <noscript></noscript> <noscript></noscript>
    This forum even has bugs! look at this mess.

  • How can i make a picture from a video file with final cut pro x?

    how can i make a picture from a video file with final cut pro x?

    Go to the "share" menu, select "save current frame"

Maybe you are looking for