How can I get the path of an existing file????

Hi.
I'm a newbie in Jsp development, so this question may appear trivial.
How can I get the path into a String of an exixting file ..like ...
String thepath = path_of("my file.txt");
Thanks for your help.

Try
application.getRealPath("myFile.txt")

Similar Messages

  • How can i get the path to config folder placed inside the jar file?

    Hi i have developed an RCP application using eclipse.
    In my application config directory is there.
    When i export my RCP application as JNLP Project the jar file is created which contains config folder inside it.
    When i download the application using java web start , how can i get the path to config folder placed inside the jar file?
    Will the config folder exists in local cache in my system?
    Help needed.
    -Deepak

    -- This works in CS6:
    tell application "Adobe InDesign CS6"
      set myDocument to active document
      set selectedRectangles to selection of myDocument
      set theGraphicsLink to file path of item link of (graphic 1 of (item 1 of selectedRectangles))
    --> "Macintosh HD:folder/folder/filename.tif"
    end tell

  • How can I get the resolution of an image file in JSP?

    how can I get the resolution of an image file like jpg,gif,png in JSP ?

    Hii,
    If by the resolution, u mean size..this is how u can come to know....
    String add = "path/to/some.jpeg";
    javax.swing.ImageIcon chain = new javax.swing.ImageIcon(add);
    int height = chain.getIconHeight();
    int width = chain.getIconWidth();
    Hope that helps.
    regards
                   

  • How can I get the path name and rename it?

    I Hope someone who knows more about automator than I can help me out here. What I'm trying to do is get the path file name, while also changing part of it. Here is my example:
    I can get the path name with this "Get Path" script I found http://automatorworld.com/archives/get-path/all-comments/
    It does half the job so I just need to tweak it but know how. When I get the path this is what I'll get: /Volumes/Public/Creative Services/Campaigns/2010/NCDDiv-32CDV Upgrade/NCDDIV-32Versions.xls
    I need to remove the beginning part"/volumes" to "file://///nhmanmkt01"
    This is so I can send the path from our sever where we keep our files to my windows friends so they can open it.
    Thanks for any help you can provide!

    ok, make the following workflow.
    1. get selected finder items.
    2. run shell script
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #ADD8E6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    for f in "$@"
    do
    echo "$f"|sed 's%/Volumes%file://///nhmanmkt01%'
    done</pre>
    set the script to accept input as arguments
    3. copy to clipboard
    save it as a finder plugin.

  • Terminal how can i get the picture dimension of a file?

    Is it possible to get the dimension of an picture (120 x 120 px) via terminal command? The information is visible under the finder "getinfo" command for picture files. Can anyone help?

    You can get image pixel size info using the ImageMagick utilities, which is a GNU package available for installation via the fink pacakage manager, then you can use the terminal command:
    identify image.gif
    ImageMagick also has several other useful conversion and image processing utilities.
    http://www.finkproject.org/
    http://www.imagemagick.org/script/index.php
    Good luck.
    P.S. - There may be ways to interact with AppleScript from Terminal to get the Finder info from a file, but I don't know how to do that.

  • How can i get the column names in CSV file.

    Hi,
    After execution of infospoke i can not see the column names in that file.How can i get column of respective infoprovider?
    Thanks,
    Gananadha Lenka

    Hello Gana,
    Actually while exporting the data using Info Spoke, we have the possibility to modify the data that we send. This is possible using transformations.
    In your Info Spoke, you have a tab called Transformations.
    Here you need to create an implementation and then use BADi to populate data.
    Check if you can write a start routine sort of thing here and insert a new record into the internal table by hardcoding with your field headings.
    Let me know if you dont know how to create transformations.
    Kris...

  • How can we get the artset from a .ai file without opening it?

    Hello All,
    I have one .ai file, lets say sample.ai file. located in C drive. so the complete file path is "C:\Sample.ai".
    and lets assume the sample.ai file has one traingle shape(3 path type arts) in it.
    Now I want to get the 3 path arts (artset)  from sample.ai file without opening it in AI.
    The function protoype is like below
    AIArtSet& artSet GetArtSetFromAFile( ai::FilePath& filePath );
    Is there any API like above function in AI? or is it possible to get the art(s) from a file without opening it in AI?

    Not to my knowlege. The API only operates on active documents as far as I know.

  • How can I get the exact pathname for a file on my computer?

    I need to enter a command in Terminal that contains the pathname of an application. I know what the path is but Terminal does not recognize it. How do I make sure the pathname is in the correct form?

    Enter the command up to the point of entering the file path and add a space, then drag the file into the terminal window. It will fill out the path.
    If you need to go further into the contents of the Application package, you can continue with /Contents...
    Another way is to start typing and then hit Tab to auto-complete. It will stop where it can't determine the next letter.
    So, type /App tab and it will fill in /Applications. Type a / and start with the name of the app, then tab and it should complete. Continue till you have the correct path.
    Spaces will be replaced with \<space>, so, App Store would end up as /Applications/App\ Store.app

  • How can I get the script Export Layers to Files to export compressed pngs?

    I would love to be able to take advantage of Photoshop's compressed png when using the script Export Layers to Files. I there a way I could modify the script to do this?
    TIA!!!
    ========================
    I found it ... I needed to add a line to the pngSaveOptions (around line #886) ...
                var saveFile = new File(exportInfo.destination + "/" + fileNameBody + ".png");
                pngSaveOptions = new PNGSaveOptions();
                pngSaveOptions.interlaced = false;
                // trying to compress png files
                pngSaveOptions.compression = 9;
                docRef.saveAs(saveFile, pngSaveOptions, true, Extension.LOWERCASE);
                break;
    =========================

    It does. The standalone XML Export was only offered by itself
    in the
    registration incentives. Sorry.
    Nancy Gill
    Adobe Community Expert
    Author: Dreamweaver 8 e-book for the DMX Zone
    Co-Author: Dreamweaver MX: Instant Troubleshooter (August,
    2003)
    Technical Editor: DMX 2004: The Complete Reference, DMX 2004:
    A Beginner''s
    Guide, Mastering Macromedia Contribute
    Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP
    Web Development
    "neilcreagh" <[email protected]> wrote in
    message
    news:f4rsrt$ptf$[email protected]..
    > I've just purchased Dreamweaver CS3 and, after
    registering, the email sent
    > offered me a free gift. I chose the free font. Another
    option is the
    > Dreamweaver XML Export Extension for Spry and I would
    like to purchase
    > this (it
    > stated the value at ?15) but I can't find it anywhere?
    >
    > The interaktonline website says that its functionality
    has been included
    > in
    > the Dreamweaver Developer Toolbox - but does this mean
    that I have to
    > purchase
    > the entire toolbox?
    >

  • Getting the path of  a resource file inside the context

    I am trying to migrate some of our applications running on OracleApplicaiton Server. We have data resource xml file needs to use in the applicaiton. In Oracle Application server we used to give the actual path of the xml file to load the xml file to the parsers since we know the path of the directories after deploying the application as an ear file. How can I get the path of the files in weblogic after deployment. If this is not supported what is the alternative to get the relative path of that xml file to load in ? The xml file is in the root folder of the context.
    THanks
    Suneesh

    Hi Suneesh,
    Please try enabling the <show-archived-real-path-enabled> Tag to TRUE ...And then everything will work fine with the following code:
    context.getRealPath()
    At domain level in config.xml. For example:
    <web-app-container>
    <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
    </web-app-container>
    *****OR *****
    At the web app level in weblogic.xml. For example:
    <container-descriptor>
    <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
    </container-descriptor>
    For Archived Applications , It is always a best practice to use the getResourceAsStream() rather than using getResource().......Below code snippet should workout in 99% cases
    InputStream stream=this.getClass().getClassLoader().getResourceAsStream("someXMLorPropfile.properties");
    Thanks
    Jay SenSharma
    http://middlewaremagic.com/weblogic/?p=408  (Middleware Magic is Here)

  • How can i get the document full path in S_TieDocument?

    I create a new S_TieDocument and override 2 methods:
    extendedPreInsert and extendedPostInsert
    how can i get the document full path in these 2 methods?
    (e.g. if i use the system user to upload a new file named 'test.file' in system root path /home/system, and i want to get the document full path '/home/system/test.file', how to get it?
    anybody know it, pls tell me, thanks a lot.
    java source is as below
    package oracle.ifs.server;
    import oracle.ifs.beans.Document;
    import oracle.ifs.beans.DocumentDefinition;
    import oracle.ifs.beans.LibraryObjectDefinition;
    import oracle.ifs.beans.LibrarySession;
    import oracle.ifs.beans.PublicObject;
    import oracle.ifs.common.AttributeValue;
    import oracle.ifs.common.IfsException;
    import oracle.ord.itech.cmsdk.ws.view.EmbeddedCMSDKWebServicesWSStub;
    public class S_TieDocument extends S_Document
    public S_TieDocument(S_LibrarySession session, S_LibraryObjectData data)
    throws IfsException
    super(session, data);
    public S_TieDocument(S_LibrarySession session, java.lang.Long classID)
    throws IfsException
    super(session, classID);
    // Overrides
    public void extendedPreInsert(OperationState opState,
    S_LibraryObjectDefinition def)
    throws IfsException
    // Always call super
    super.extendedPreInsert(opState, def);
    // Get the LibrarySession
    S_LibrarySession session = getSession();
    def.setUserSetAttribute("CUSTOMATTRIBUTE",
    AttributeValue.newAttributeValue(""));
    //how can i get the document file full path here?
    public void extendedPostInsert(OperationState opState,
    S_LibraryObjectDefinition def)
    throws IfsException
    // Get the LibrarySession
    S_LibrarySession session = getSession();
    //how can i get the document file full path here?
    }

    In the new version of Numbers this option is not available.  You will have to type the file name into the header yourself.  You can post feedback to Apple using the menu item "Numbers > Provide Numbers Feedback"
    or use Numbers2.3 which should be in the folder "/Applications/iWork '09" if you previously had it installed

  • C Programming: How can we get the filesystem name for a given file-path?

    C Programming: How can we get the filesystem name for a given file-path?
    Say I have a filepath=/mnt1/file1
    Using some OS API like stat, can I get the Filesystem /mnt ?
    Thanks in advance,
    -V

    Enter the command up to the point of entering the file path and add a space, then drag the file into the terminal window. It will fill out the path.
    If you need to go further into the contents of the Application package, you can continue with /Contents...
    Another way is to start typing and then hit Tab to auto-complete. It will stop where it can't determine the next letter.
    So, type /App tab and it will fill in /Applications. Type a / and start with the name of the app, then tab and it should complete. Continue till you have the correct path.
    Spaces will be replaced with \<space>, so, App Store would end up as /Applications/App\ Store.app

  • Teststand 1.03 - How can I get the sequence file path into an expression?

    The sequence file will be located at different locations on different computers. I need the base address of the sequence file to get to the correct limits file. How can I get the sequence file path into a string-local expression.
    Thanks

    As Ray described, the FindFile expression function and TS API method will seach all TS search directories and return to you the path of your file, assuming the file is located in the search directories.
    If you just want the path of a TS file that you have a reference to then there is a faster, easier method. You can use the Path property of the PropertyObjectFile class. In the attached example I use an AcitiveX Automation adapter step to call Path on the property RunState.SequenceFile. This returns the path to the current executing sequence file. Note that if you have not yet saved the sequence file then the path will be empty. In a subsequence step I strip off the file name leaving the root path of the file.
    Attachments:
    GetSeqFilePath.seq ‏22 KB

  • How can I get the direction handles to show up for the Position attribute?

    How can I get the direction handles to show up for the Position attribute?
    I have CS3 and I did the formentioned test and was able to make the handles work for the scale attribute but they don't seem to show when editing the position values.
    *I am in the graph editor looking at the "value graph"
    *I select the keys and convert the keys to auto bezier (I also tried the ease in and out buttons)
    *It changed the graph the way you might think (no longer linear) however the handles are not showing to edit further.
    *I also tried using the "convert vertex tool" (part of the pen tool) and still no luck getting those handles.
    *the handles only show up in the speed graph but that does me no good.
    Please help!
    THANKS 

    I don't have CS3 installed on any of my machines any more but your value graphs for position should look something like this:
    There are no handles for position in the Graph editor. You adjust the position curve by editing the motion path in the composition window. Press the G key to bring up the pen tool, then use the modifier keys Crtl/Cmnd and Alt/Option to temporarily switch between select and convert vertex to adjust the paths. Changes will be reflected in the value graphs. You will get editable handles with scale and rotation because these are not spatial properties. Spatial properties, position, Anchor Point, all XY & Z coordinates are edited in the comp window or in the layer window after revealing the properties. IOW, you edit anchor point position paths by opening up the layer window and choosing Anchor Point from the display options.
    The Manual isn't wrong. Here's a link to the live docs.

  • Given an alias created by the Finder, from the Unix prompt (e.g., in Terminal) how can I get the target of the alias?

    In my Finder windows I have numerous aliases that point mostly to other folders. When in the Terminal, these aliases present as regular files. How can I get the target of an alias so that I can perform some operation, e.g., "cd", on the target?

    This AppleScript demonstrates how to resolve the OS X alias and return a POSIX path for it
    set af to choose file
    tell application "Finder"
      if the kind of af is "alias" then
      set origFile to the POSIX path of ((original item of af) as text)
      end if
    end tell
    display dialog origFile

Maybe you are looking for

  • How do I export 5.1 audio plus stereo audio in the same sequence?

    For final broadcast delivery, we need to provide a ProRes 422 video with 48, 24bit audio on 8 tracks according to the following configuration.  How do I do this in Premiere since it does not have a true, discrete 5.1 channel or outputs? Channel 1 Sur

  • Report Painter and Report Writer (URGENT)

    Hi All,      Please can you send me Step by Step screen shots Configuration document for Report Painter and Report Writer, If any body send relavent data i will give reword points, Regards, TML

  • I need code example for server act as client and vice versa

    Hi all, I want code example for performing both server and clients using RMI. I mean Server will act as client and client will act as server. So a single program will act as both client and server . Please give example, it will helpful to complete my

  • DBAdapter not working in SOA 11g

    Hi All, I created a simple composite to insert a row in database table. However, it 's failing. I have set up the weblogic server per the following link: http://download.oracle.com/docs/cd/E12839_01/integration.1111/e10231/life_cycle.htm#BABJFGGF - t

  • Datafile got corrupted

    Dear Friends Ours Development project, Here we are using Oracle 8i database on sun solaris 5.8 version. Our database is in ARCHIVELOG MODE only. Yesterday one of our user datafile got corrupted. and we have only 3days archivelogs. We dont have any ph