What about executing a .pdf or what other files from a jar?

Yesterday I started a topic for how I can use files that are situated in my project .jar file.. we discussed this problem and finally a solution has been proposed in the bellow link
http://forum.java.sun.com/thread.jspa?threadID=788322&tstart=0
and
http://forum.java.sun.com/thread.jspa?threadID=788381&tstart=90
After all the discussions I have undrestood that we can not use File class and we should use URL to give the path of a file but what if I need to execute a PDF file by clicking an icon or button? For this either I need to used File or string of this file which does not work! it means that if I have an .jar application that wants to give a link to a .PDF file (which is situated in the same .jar file) I can not do that??
to execute this pdf. file I use:
Process p = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + getClass().getClassLoader().getResource("docs/theory.pdf").toString); //the path to the file name on stringor
Desktop.open(new File("docs/theory.pdf")));but neither works the .jar file can not find the file..
What do u propose?? does any one has any idea??
Thanx for helping and participating

hi!
just another suggestion.. why don't you extract the .pdf file into a temp directory, and then Call the Desktop.open(new File("docs/theory.pdf"))); , the other snap is i think OS dependent, and violate the platform independency law.
:)

Similar Messages

  • So I have a file on my desktop and I cannot open it, move it to a folder, or delete it from my mac. I dont know what it has in it, and that makes me suspicious. What can I do to remove this unremovable file from my computer? Is it a virus?

    So I have a file on my desktop and I cannot open it, move it to a folder, or delete it from my mac. I dont know what it has in it, and that makes me suspicious. What can I do to remove this unremovable file from my computer? Is it a virus?

    First, I would recommend repairing the hard drive with Disk Utility.
    If that doesn't fix the problem, there's a very dangerous command you can execute in the Terminal.  This is very hazardous, because a simple typo can result in very drastic consequences.  I have seen people erase their entire hard drive by putting a space in the wrong place!  So, please follow the directions I'm going to give you very carefully!
    Open the Terminal, which is found in the Utilities folder in the Applications folder.  In the Terminal, enter the following:
    sudo rm -f
    Make sure to put a space after the "-f"!  Then, drag the troublesome file from the Finder and drop it on the Terminal window.  That should insert the path to the file in the command.  Then go back to the Terminal and press return.  You will be asked for your password, and when you type it, nothing will be shown as a security measure.  Press return again after entering your password.  The file should be deleted.

  • What are the commands available to read a file from application server and

    What are the commands available to read a file from application server and store the file into an internal table?

    Hi,
    To read a file from an Application Server to an Object there is a command in ABAP called <b>READ DATASET</b>. After that file is transported to that object you have to do a loop and put that data in an Internal Table.
    This statement exports data from the file specified in dset into the data object dobj. For dobj, variables with elementary data types and flat structures can be specified. In Unicode programs, dobj must be character-type if the file was opened as a text file.
    For dset, a character-type data object is expected - that is, an object that contains the platform-specific name of the file. The content is read from the file starting from the current file pointer. After the data transfer, the file pointer is positioned after the section that was read. Using the MAXIMUM LENGTH addition, the number of characters or bytes to be read from the file can be limited. Using ACTUAL LENGTH, the number of characters or bytes actually used can be determined.
    In a Unicode program, the file must be opened with an arbitrary access type; otherwise, an exception that cannot be handled will be triggered.
    If the file has not yet been opened in anon-Unicode program, it will be implicitly opened as a binary file for read access using the statement
    OPEN DATASET dset FOR INPUT IN BINARY MODE.
    . If a non-existing file is accessed, an exception that can be handled can be triggered.
    Influence of Access Type
    Files can be read independently of the access type. Whether data can be read or not depends solely on the position of the file pointer. If the latter is at the end of the file or after the file, no data can be read and sy-subrc will be set to 4.
    Influence of the Storage Type
    The import function will take place irrespective of the storage type in which the file was opened with the statement OPEN DATASET.
    If the file was opened as a text file or as a legacy text file, the data is normally read from the current position of the file pointer to the next end-of-line marking, and the file pointer is positioned after the end-of-line marking. If the data object dobj is too short for the number of read characters, the superfluous characters and bytes are cut off. If it is longer, it will be filled with blanks to the right.
    If the file was opened as a binary file or as a legacy-binary file, as much data is read that fits into the data object dobj. If the data object dobj is longer than the number of exported characters, it is filled with hexadecimal 0 on the right.
    If the specified storage type makes conversion necessary, this is executed before the assignment to the data object dobj. Afterwards, the read data is placed, byte by byte, into the data object.
    System Fields
    sy-subrc Meaning
    0 Data was read without reaching end of file.
    4 Data was read and the end of the file was reached or there was an attempt to read after the end of the file.
    Thanks,
    Samantak.
    <b>Rewards points for useful answers.</b>

  • What plug-in do I need to import file from scanner to make a batch job

    what plug-in do I need to import file from scanner to make a batch job

    Hi Atul,
    I`m having PS Elements Ver.13 and scanner Epson V500 Photo.
    Nice if your can help me.
    Sten

  • I have quicken 2000 for mac on an old mac and wish to upgrade to a new laptop running snow leopard.  Quicken 2006 on my new laptop runs, but will not recognize the old data qif files.  What version of quicken for mac will recognize files from 2000?

    I have quicken 2000 for mac on an old mac and wish to upgrade to a new laptop running snow leopard.  Quicken 2006 on my new laptop runs, but will not recognize the old data qif files.  What version of quicken for mac will recognize files from 2000?  Or, is there a special procedure I should be following?

    can't open Quicken 2000 files in classic mode on new MacBook Pro version 10.6.7

  • Creating PDF/A 1-a file from Tiff Image

    I am trying to create a PDF/A 1-a file from a Tiff Image file. But it gives an error.
    When i try to check the compliance using Preflight, I find that StructTreeRoot is giving the problem.
    Can anyone suggest how to converty Tiff image to PDF/A 1-a compliant pdf file.
    I am using Adobe Acrobat Pro 9 Version 9.0
    Regards,
    Abhilash

    Thanks for the prompt reply.
    But i have created a pdf/a 1-a file from a tiff file using tool img2pdf.exe provided by www.pdf-tools.com
    It created a pdf/a 1-a file which the preflight shows as a pdf/a 1-a compliant PDF.
    Regards,
    Abhilash

  • Executing .jar files from another .jar file.

    How would I run one .jar file from another .jar file. and is there anyway to call specific class arguments? Because I have one .jar file that reads a specified file and returns its contents.
    So how would I execute it and specify its arguments and how would I make it return something to the executing jar file?

    Because I have one .jar file that reads
    a specified file and returns its contents. Presumably you have a class that does that, and you have that class stored in a jar. And you want to know how to... um... do something with that class. I say "um..." because normally you don't execute a class, either, you either call its static methods or you create an instance of the class and call its instance methods.
    If you have been writing a whole lot of little classes each of which just has a static main method, then stop doing that. Write real Java classes instead. The tutorial is here:
    http://java.sun.com/docs/books/tutorial/java/index.html

  • HT3702 Why can't I download my already purchased music and other files from iCloud, even though I owe money to iTunes for my most recent purchases.  Doesn't seem right that they keep me from accessing those files which I've already paid for!

    Why can't I download my already purchased music and other files from iCloud, even though I owe money to iTunes for my most recent purchases.  Doesn't seem right that they keep me from accessing those files which I've already paid for!

    - Are you saying that they are not listed in your Purchased section?
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    - Are they listed in your Puchases history when you log into your account on your computer?
    - Are they still available now for purchase? If not then you are out of luck
    If they are still available and listed in your Puchase History then contact iTunes
    http://www.apple.com/support/itunes/

  • I can't transfer music and other files from library to my iphone 4 by dragging it.can anyone help me?is there any other way to transfer files into iphone?

    i can't transfer music and other files from library to my iphone 4 by dragging it.can anyone help me?is there any other way to transfer files into iphone?

    If you want to drag and drop ( don;t know why you would do this), you will have to check manually manage music.
    Why not just sync?
    iPhone User Guide (For iOS 5.0 Software)

  • What about my current PDF files?...

    Hi,
    A couple of questions:
    1. I've dozens of PDF books bought in O'reilly and Amazon book stores. Is there a way to dump my PDF files to my future iPad through iTunes or other apps?
    2. How the gift card works?... I mean, if the Apple store for iPad isn't available in Belgium; should I register an USA-Apple store account's in order to buy apps with my gift card?
    Thank you for your comments.

    One more vote for Goodreader. I have it and have dumped about 50 ebooks and about the same number of manuals in Pdf format on the iPad. Display quality is excellent.
    To use it, simply download and install the app from the app store, then when the iPad is connected to the system, launch iTunes, go to the apps tab, and scroll down to the window which indicates which apps can sync documents directly to the iPad. You can then click the 'add' button to navigate to the file on your system, or just drag and drop the file into the space in iTunes, and it will automatically sync to the iPad.
    Goodreader can also handle other file types, including Word documents as long as they are not too long. Well worth .99c!

  • HT4009 What about upgrading? I can't do that from where I live w/o connecting to my hd. Now with the new changes to ITunes, I don't see how I can upgrade thru the traditional route I took b4. Now what do I do?

    What about upgrading apps on your IPhone? I can't do that from where I live w/o connecting directly to my laptop. With Apple's new Itunes page, I don't see how I can navigate successfully now to acheive the same result as before. Hmmm. I would appreciate some quick guidance. Thanks.

    With iTunes 11 you can enable the left-hand sidebar that used to show on previous versions of iTunes via option-command-S on a Mac, control-S on a PC. You can then select the Apps part of your iTunes library on that sidebar and on the right-hand side of iTunes click the Check For Updates button at the bottom to see if any of your apps have updates available. Then connect your phone and select it on the sidebar, and on the Apps tab on the right-hand side click the Sync button at the bottom of it to copy the updates over

  • HT3258 what about final cut does not recognize mts file

    what about final cut does not recognize mts file

    If you have an AVCHD camcorder, you need to select one of the AVCHD Apple Intermediate Codec Easy Setups in FCE that matches how you shot the video in your camcorder.  (eg, AVCHD Apple Intermediate Codec 1920x1080i60 would be appropriate for camcorders produced for North America unless you selected some other video type in the camera's setup.)   After selecting the appropriate Easy Setup, create a new sequence then import the video from your camcorder.
    If you only have the .mts files themselves (perhaps because you copied them to your hard drive without their entire surrounding AVCHD folder structure), that's another matter.  In that case you need Clipwrap or similar app to transcode the .mts files to QuickTime/Apple Intermediate Codec before importing them into FCE.   You still need to have the correct easy setup in FCE.
    It would help to know exactly what make/model camcorder you have, and what model Mac and versions of OS X and QuickTime.

  • Is it possible to convert . AIR file to PDF or any other file format ??

    please help solving this problem...

    Hi Don,
    Muse files has an extention .muse and this cannot be opened in Adobe Edge Animate. What you can do is, Export your .muse file as HTML using Muse.  Now, open the html file that muse generates for its pages in Adobe Edge Animate.
    From there, you can publish the html file as an .oam file using Adobe Edge Animate .
    However  please make sure that you have changed the publish settings in Adobe Edge animate such that it is also creates a .oam file for your html file when it publishes.
    Please do let me know if you are able to do this.
    Regards,
    Rohit Nair

  • What kind of adapter i need to transfer file from an imac hardrive tiger to an imac leopard

    what kind or brand of usb adapter i need to transfer file from an imac hardrive tiger to an imac leopard

    Hey arturojas!
    Here is an article that might help you achieve this goal:
    Mac Basics: File Sharing
    http://support.apple.com/kb/ht1549
    You could also transfer files directly using target disk mode:
    Mac OS X 10.6: Transferring files between two computers using FireWire
    http://support.apple.com/kb/PH6815
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • In anticipating upgrading to Premiere Elements 13, I need to know what "gotchas" there might be in loading project files from version 10 (in case someone needs another DVD/Blu-Ray)

    Particularly, can I load project files from version 10 (in case someone needs another DVD/Blu-Ray)

    cbjameson
    What computer operating system is involved?
    There is no guarantee that a project created in an earlier version can be opened in a later one. Many times it can, but...
    If you do try this, then please consider working from a copy of the project 10 project file and then trying to open that in 13/13.1.
    Reason: projects created in an earlier version and then opened and edited in a later version cannot be opened again in the
    earlier version.
    And, there is always the issue of maintaining the connect of the source media with the project file. Is this move from 10 to 13/13.1
    happening on the same computer and are the source media in the same place where they were when they were first imported
    into the 10 project. Disc menus consideration may enter into this depending on your details.
    ATR

Maybe you are looking for