Getting file location and display!

Hello friends,
I need to find out the file path and display it using java.
Is it any specific java cmd for it.
For example, if i store a file in d:/javaworks/ram/one.txt, then i need to retrieve the path and show it in command window.
pls, reply me as soon as possible.

For example, if i store a file in d:/javaworks/ram/one.txt, then i need to retrieve the path and show it in command window.Using your example above, since you know where you placed it, use
System.out.println("d:/javaworks/ram/one.txt");

Similar Messages

  • Getting file data and displaying it in a dynamic text box

    The purpose of this function is to load and display a
    specific menu for a restaurant (lunch, dinner, dessert, etc.)
    This script is located inside of a movie clip that has the
    text box and buttons.
    There are 4 buttons that have event listeners that go to a
    function that determines which button was pushed, and then sends a
    call to loadMenu with a string that has the filename.txt.
    In frame 1 of the movie clip, the variables used in the code
    are declared as such:
    var newMenuRequest:URLRequest = new URLRequest();
    var newMenuLoad:URLLoader = new URLLoader();
    var loadThisMenu:String = ""; //This is the variable the
    buttonclick function alters and sets as the string to send to the
    loadMenu.
    My error is 1195: attempted access of inaccessible method url
    with static type flash.net:URLRequest
    Any ideas?

    quote:
    Originally posted by:
    GWD
    newMenuRequest is an instance of a URLRequest.... and it
    doesn't have a url method.
    It has a url property.
    I would be inclined to create a new URLRequest each time. But
    perhaps that's not necessary.
    Try changing
    newMenuRequest.url(menuName);
    to:
    newMenuRequest.url=menuName;
    see if that works.
    Yeah I realize it's a little inefficient.
    THANK YOU SO MUCH FOR THE SUGGESTION. works perfectly.

  • File location and address corrupted, can not open pdf, any way to fix this?

    What is the easiest way to correct the file location and address  in a windows file system?

    Sorry, I don't understand your question - can you elaborate?

  • How do I select multiple files under "Get File Info"and lock or unlock all?

    How do I select multiple files under "Get File Info"and lock or unlock them all? It seems to do it automatically when I have 10 or more selected. But how do I lock or unlock 5 or 6 files in one swoop? Thanks

    Select the desired files then press OPTION and select Show Inspector from the Finder's File menu.
    Why reward points?(Quoted from Discussions Terms of Use.)
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

  • Can i get mouse location and event outside JFrame?

    Can i get mouse location and event outside JFrame?
    any related link or document? thx~

    what I figure out from your question is that, you want to get the coordinates even if the mouse is not directly interacting with any of the java components of your application.
    I would consider this as an interaction with the OS so that it sends a call to your java program as well when ever the mouse event occurs. If you use JNI to catch system events, I think it should work.

  • Image: display from local drive, upload to server file system, and display from server

    Hello,
    I am using jdev 11.1.2.4.0...
    The requirement is that users would like to upload images from their local drive to server drive and they would like display images from server drive later.
    We don't want to keep images in database. I am not sure what the solution should be; however, I plan to ....
    1. create a table to keep an information of images -- image_id, image_location (server drive), image_filename
    2. create a page where users can enter image information and specific filename from a local drive (I think I will use inputFile component) and provide the preview button to display an image on screen before save it. To save data is to save information to the database and copy an image file to the server drive (the destination location for image files is predefined.)
    3. create another page where users can browse information from the database and display an image for a selected record by getting from the server.
    I need suggestions on...
    1. how to display an image on page from the local drive?
    2. how to copy a file from a local drive to a server?
    3. how to display an image on page from the server drive?
    Thank you.
    nat

    See:
    http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-1/
    http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-2/
    http://tompeez.wordpress.com/2011/12/16/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-3/
    Where Timo saves images to the database, you save it to the file system (examples on how to do this from Java are available plenty if you just Google for it). Similar to Timo you then use the image tag to display images. The difference is that you can directly add the URL from the database table.
    The benefit of using a database to host images is that you are not dependent on file server structures though
    Frank

  • File location and name

    If I use iPhoto to import files from my camera where are the files actually stored and how do I change the actual file name? I have figured out how to change the picture title but it does not change the file name.
    If I use iPhoto to import pictures from the hard drive do they get copied to the iPhoto file location or just linked? When I moved to the mac I created a folder named "old laptop stuff" and moved everything to that folder. I am now trying to organize all of this stuff on the mac. Can I delete the picture files from the old laptop stuff folder after using iphoto to import and organize them?

    Hi Dispatcher,
    Where are the files stored? Take a look at the screenshot.
    iPhoto 6 Library folder in the Finder
    As you can see the structure is now related to rolls. Rolls are created for each folder you import and each import session from a camera.
    It is very easy to change the names of film rolls within iPhoto to make them easier to find images within. Open the info panel in iPhoto by clicking on the "i" icon. Once it is opened, click on the roll title in the viewing window.
    Click on the word "title" in the info pane and type in your new title. I like to use a date and text format such as 12/25/05 Christmas at Mom's, 1/05/06 my birthday, etc. Once the roll names are changed within iPhoto, they are also changed within the Finder, making it easy to locate an image.
    When importing from a camera, make sure you name the roll with a date and text before the import.
    You can add titles in iPhoto, but as you found out only iPhoto sees these new titles. To do what you want you have to name the photos before importing into iPhoto. Either download to the computer with your camera software or use Image Capture (found in your Applications folder) to download the photos.
    Launch Image Capture (keep the little window open that says no camera is connected or IC will quit if you close the window)
    Go to Image Captures preferences and choose what you want to happen when a camera is connected.
    Next time a camera is connected, if you chose Image Capture to open, then IC will open and download the photos.
    Rename your photos then import them into the library
    You can choose to do it either way when you first use iPhoto (this is new in version 6)
    If you choose to copy into the library when importing, then the photos are copied into the library (iPhoto Library folder in the Finder)
    After you have imported all those folders of images, you can then delete the folder.

  • File name and displaying images

    I am trying to rename all the jpg files i have in my directory, to consecutive number. eg. 1.jpg, 2.jpg. as a new comer to the java world, im not too sure if i have doen it right. could you check...
    Also, after i renamed the files i want the images displayed side by side across the screen..
    This is teh code...
    import java.awt.*;
    import java.applet.Applet;
    import javax.swing.*;
    import java.io.*;
    import java.io.File;
    import java.io.IOException;
    public class GetImages extends Applet {
         public static void main(String[] args) throws IOException
    // File (or directory) with old name
        File file = new File("picture1.jpg");
        // File (or directory) with new name
        File file2 = new File("1.jpg");
        // Rename file (or directory)
              int xx;
              xx = 0;
       if (xx<500) {
       file.renameTo(new File(xx+".jpg"));
         xx++;
    private Image image;
    public void init() {
       image = getImage(getDocumentBase(), (xx+".jpg"));
    public void paint(Graphics g) {
         int x, y, counter, numberOfImages;
    x = 0;
    y = 0;
    counter = 1;
    numberOfImages = 21;
    while (counter != numberOfImages) {
              g.drawImage(image, x, y, 15, 15,this);
              x = x + 15;
              counter++; im not too sure where i am goign wrong?

    You're really trying to do two things: rename the files and display the images. Let's work on one at a time. First, to rename the files, you'll need to get a list of the files in the directory. Look at the Javadocs for java.io.File (http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html) for the way to do this.
    Once you have the list of files, you need to loop through them and rename each one. A for loop will be a good way to do this. You'll have an array of Files, so your code might look something like this:
    // Get your array of Files and call it something simple like 'files'
    int numFiles = files.length;
    for( int x = 0; x < numFiles; x++ )
    // Rename the file
    }The for loop will start at 0 and loop until x is equal to numFiles.

  • How to get Storage Location and Vendor details in MD03 automatically

    Hi folks,
        We want to create automatic PR and PO from Planned Order.
    But when PR gets created in MD03, the values for Purchase organization, Storage Location and fixed vendor are blank, even after maintaining source list with fixed vendor .
    How to populate these values automatically ?
    I am also attaching screenshot of MD03 screen

    Hello
    If you are creating the orders using MRP, you should make sure that the field MRP is set to 1 on the source list. The field 'fixed vendor' is not relevant to MRP. When the vendor is selected from the source list, the purchasing organization should be also copied to the purchase requisition.
    The storage location will be copied from the respective field on the material master tab MRP2.
    Also take a look on the following document:
    MRP: Vendor is not selected and general problems on source determination
    BR
    Caetano

  • Get file name and path from  adf inputFile

    Hi,
    I use adf's inputFile component. I need to get the file name and filePath. Does anyone knows how to do that?
    Thanks in advance

    You may bind the value to an UploadedFile object and get the name from this object.
    You may use a valueChangeListener backin bean method or a managed bean.
    Here the code i just write for something similar. Note that i'm not able to test it because of a bug in 10.1.3.1 with inputFile and web.xml parameters. I still waiting for the patch.
    public void uploadedFile(ValueChangeEvent valueChangeEvent) throws IOException,
    Exception {
    final int BUFFER = 2048;
    byte data[] = new byte[BUFFER];
    int currentByte;
    String fileName;
    UploadedFile uploadedFile =
    (UploadedFile)valueChangeEvent.getNewValue();
    if (uploadedFile != null) {
    String mimeType = uploadedFile.getContentType();
    if (mimeType == "application/x-zip-compressed") {
    // get the uploaded file as a zip file
    ZipFile zipFile = new ZipFile(uploadedFile.getFilename());
    // verify the zip archive contains only one entry
    if (zipFile.size() != 1) {
    FacesContext context =
    FacesContext.getCurrentInstance();
    ResourceBundle errorMessage =
    ResourceBundle.getBundle(context.getApplication().getMessageBundle());
    Exception ZipFileContentException =
    new Exception(errorMessage.getString("error.fileUpload.zipFileContent.moreThanOneEntry").replace("{0}",
    String.valueOf(zipFile.size())));
    throw ZipFileContentException;
    // get the entries in the zip file even it is only one
    Enumeration zipFileEntries = zipFile.entries();
    // Process each entry
    while (zipFileEntries.hasMoreElements()) {
    // grab a zip file entry
    ZipEntry entry =
    (ZipEntry)zipFileEntries.nextElement();
    // check the entry is not a directory
    if (entry.isDirectory()) {
    Exception ZipFileContentException =
    new Exception(JSFUtils.getStringFromBundle("error.fileUpload.zipFileContent.isDirectoryInsteadFile"));
    throw ZipFileContentException;
    File destFile = new File(entry.getName());
    Magic magic = new Magic();
    // getMagicMatch accepts Files or byte[],
    // which is nice if you want to test streams
    MagicMatch match = magic.getMagicMatch(destFile, true);
    if (match.getMimeType() != "application/xml") {
    Exception ZipFileContentException =
    new Exception(JSFUtils.getStringFromBundle("error.fileUpload.isNotXMLFile").replace("{0}",
    match.getMimeType()));
    throw ZipFileContentException;
    //TODO get the repository directory from classification-param.xml
    BufferedInputStream is =
    new BufferedInputStream(zipFile.getInputStream(entry));
    FileOutputStream fos = new FileOutputStream(destFile);
    BufferedOutputStream dest =
    new BufferedOutputStream(fos, BUFFER);
    // read and write until last byte is encountered
    while ((currentByte = is.read(data, 0, BUFFER)) !=
    -1) {
    dest.write(data, 0, currentByte);
    dest.flush();
    dest.close();
    is.close();
    zipFile.close();
    } else if (mimeType == "application/xml") {
    String currentEntry = uploadedFile.getFilename();
    File destFile = new File(currentEntry);
    BufferedInputStream is =
    new BufferedInputStream(uploadedFile.getInputStream());
    FileOutputStream fos = new FileOutputStream(destFile);
    BufferedOutputStream dest =
    new BufferedOutputStream(fos, BUFFER);
    // read and write until last byte is encountered
    while ((currentByte = is.read(data, 0, BUFFER)) != -1) {
    dest.write(data, 0, currentByte);
    dest.flush();
    dest.close();
    is.close();
    } else {
    Exception ZipFileContentException =
    new Exception(JSFUtils.getStringFromBundle("error.fileUpload.isNotXMLFile").replace("{0}",
    mimeType));
    throw ZipFileContentException;
    }

  • Ho to get file name and full path of a local file

    I want to be able to get the file name and it's full path of
    a local file. I was thinking of using "FileReference" but
    FileReference doesn't permint accessing the local file path. Can
    anyone suggest a way of doing this.
    Thanks

    You will have to create 2 different versions.
    See this example we have created using JSystem
    http://jsystem.flashjester.com
    Download the example file provided.
    Hope this helps.
    Regards
    FlashJester Support Team
    e. - [email protected]
    w. - www.flashjester.com
    "This has been one of the most impressive and thoroughly
    pleasant
    experiences of customer support I have ever come across -
    astounding!"
    Director - hedgeapple

  • Need to get file name and directory back from file adapter - WRITE

    I am using the file adapter to write a file. I want to log the file name of the file we just created. Since we use a precise timestamp in the file name, I can't accurately guess.
    I have an invoke in my BPEL process to the file adapter. My first try was to assign the jca.file.FileName property to a variable, but it never comes back. I looked around and saw plenty of ways to SET the file name for a write and GET the file name for a read, but no GET file name for WRITE.
    Anyone have a solution?
    Thanks in advance!

    I think I got your point... You can tell FileAdapter the filename to write, but if you don't then FileAdapter can not tell you the filename that it wrote... I think it is pretty possible Oracle didn't implement the latter, as the write operation is probably asynchronous and the filename is calculated later on...
    If what you want is just log, you may achieve your requirement by increasing verbosity on Adapter logs... Have a look at the link bellow...
    http://docs.oracle.com/cd/E15586_01/integration.1111/e10226/ad_mon.htm#CJHHBBID
    Otherwise, the solution for you will be to calculate filename yourself, and that will be a little bit of reinventing the wheel... But at least you will know the filename...
    Cheers,
    Vlad

  • Using AppleScript/Automator to get file path and create AFP hyperlink

    Hi All,
    A colleague has asked for a service (contextual menu item in Finder) to get a selected item's remote (afp://) file path and copy it to the clipboard...  Pretty sure I've got that part down. 
    What I need advice on is how to make the resulting pasted file path into a serviceable hyperlink.  AFP keeps telling me there was an error connection to the server....  Does the copied path have to include mounting commands and user credentials for this to work??
    Thanks,
    Nathan

    Hi Richard - here's the script:
    tell application "Finder"
              set sel to the selection as text
              set TempTID to AppleScript's text item delimiters
              set AppleScript's text item delimiters to space
              set sel to text items of sel
              set AppleScript's text item delimiters to "%20"
              set sel to sel as string
              set AppleScript's text item delimiters to TempTID
    set the clipboard to "file://" & POSIX path of sel
    end tell

  • Where are keyword files located and how do I get them into lightroom 4?

    I have upgraded from lightroom 3 to lightroom 4.  In many cases the keywords are missing - sort of. When I click on a single photo, the keywords don't show up.  If I select a bunch of photos, the keywords show up as a group.  Why aren't they listed for individual photos?  How can I get them "connected" without redoing each photo?  Let me know if you need more information.  It seems I read somewhere that the keywords are kept in a separate file (many of these photos are jpg, so I'm not talking .xmp), but I can't find where I read this.  Anyone know?
    Thanks for help.
    Margaret

    Hello.  It looks like I recovered all my keywords attached to photos.  What I did:
    First I located all photos without keywords using a metadata search.
    I found that it seemed to be certain groups of photos that had no keywords.  I decided to at least get the main keyword on all of those in a particular group, like Canyonlands. 
    Once I added one of the keywords, the others all showed up magically!  I then went to each group of photos and added the main keyword, and the others came along and attached to the photos.
    Don't understand why this occurred or why it got fixed, since it was so random.  But, I'm glad to have my keywords restored (I had divided flowers by color, etc. so it was a lot of work!)
    Thanks for the discussion and help.

  • Setting project default file locations and a few random interface questions

    I apologize for the randomness of this post, but it seemed better than spamming a bunch of different posts in a short period of time.  I've been using Premiere Elements 9 for about 6 months now and there are a few little things that I'd like to tweak.
    I'd like to change the default file save location for a project.  I've got different projects in different folders and it seems like I should be able to set a default save location for each project.  All I've ever been able to find in the help is how to set the scratch folder, which is different.
    I'd like to change the default encoding preset for a project.  For example, I have a custom preset for mp4 under the mobile phone category.  It would be nice to have that be the default whenever I pick the mobile phone category.
    With birthdays and concerts and plays and all that stuff I have about 50 videos and a couple hundred large photos already.  Every time Premiere loads, it takes a few extra seconds to load up all of the thumbnails.  I hide all the videos and pictures on the Organize tab and save the project, but it never sticks.  Is this just impossible?
    Finally, every so often, the end-of-clip marker acts funny.  I don't know what the proper name for it is, but it is the thing under the mouse cursor in the picture below.  It used to automatically move on the time line as I added or deleted clips.  Somehow I clicked a button and it no longer does that.  After a week or so of not working, it goes back to automatically adjusting as I add and delete clips from the timeline and then it will break again.  Ideas?
    Also in the timeline, I now have this huge gap of nothingness on top of video 1, see picture.  My ocd says that Video1 and Audio 1 should be at the very top and the gap should be on the bottom.  Ideas?
    Thanks,
    Bob

    I kind of wish you'd have spread these questions out over a couple of posts so that we could answer each thoroughly. If I answer all of them in depth in a single post, this answer would be the size of one of my books! (which, by the way, contain many of the answers to these questions.)
    1. The default save location for your videos should be the last place you've saved your video to. So that should happen automatically. Although in my books I recommend that, whenever you start a new project, you create a new folder for it. This is good housekeeping and a good way to keep your tmp and render files in the same place on your drive, which has a number of advantages.
    2. You can't create a custom project preset. The only presets available are the ones Adobe provides. And, although they are pretty extensive, some non-traditional formats (like video from some mobile phones) are not well supported. You may be able to get it to work -- but it's usually a hybrid solution and, personally, if you plan to use your phone's video as your main video source, I'd recommend you look at another video editing program. Premiere Elements doesn't do the hybrid stuff well. It's ideally suited for video from traditional camcorders.
    3. The thumbnails you see when the program loads are not in your current project. At least not until you import them into your Project panel. That Media panel is merely a preview to what's in your Organizer catalog. As I explain in my book, it's usually best to ignore this panel until you really learn your way around the basics of this program. It's very confusing. Fortunately, it adds very little load time to the program itself -- regardless of how much time it seems to add.
    4. The thing in the illustration is the Work Area Bar. It's used to isolate a segment of your timeline for rendering, etc. Usually, it will shrink and grow as you add and remove video from your timeline. Unfortunately, there's a bug in version 9 and, if you manually change it once during a project, you'll have to manually change it for the rest of the time you work on the project. But, if you drag each end of the Work Area Bar to cover your entire timeline of videos, your project shouldn't misbehave.
    5. The "gap of nothingness" on your timeline is just room for you to add more audio and video tracks if you'd like to. It's a good thing to have! BTW, as I'm sure you know (and my books, once again, explain) you can toggle the tracks on your timeline so that they display as either compressed (as in your illustration) or wide open, which allows you to see your clips and control audio and video levels. Once again, this is a very good thing!
    Happy moviemaking.

Maybe you are looking for