Extracting certain files from a jar

I am creating a jar that when d-clicked on will extract its files to the computer the jar resides on. Here is my question: how do I get it to only extract certain files(ie. all files except the classes used to give the extraction command upon d-clicking and the manifest)?
Thanks!!

The following post won't solve the doubl clicking problem, but it will get you started on getting specific files from a Jar.
Go to:
http://forums.java.sun.com/thread.jsp?forum=22&thread=138514

Similar Messages

  • Extracting certain files from faulty HD

    Hi, i'm trying to recover /home/kris/.zsnes/Legend of Zelda, The - A Link to the Past (U) [!].srm and (i guess, if i need it) /home/kris/.zsnes/Legend of Zelda, The - A Link to the Past (U) [!].zst first and foremost. They are zsnes and snes9x save files. I'm trying to recover them from a faulty HD which is an ext3 and is LVM2 formatted.
    I can't mount the disk, nor does testdisk or photorec work(they both hang). SO since this is such a messed up drive i figured i would try to read the disk in hex and only extract the pieces i need to. I know "where" they are on the disk, as mentioned above, but i don't know where to go from here. I suppose to exert the disk as little as possible(to avoid more mucking up) i need to:
    1. find out where the files are physically stored(hopefully they are in the same block/sector <- i don't really understand what this means _exactly_..)
    2. read as little as possible/take as little a risk as possible and only extract exactly the bits needed and store them on the new HD as files.
    But... HOW would i go about doing this, which programs would i use(the best would be if i could script it i suppose, as then i would only access exactly the portions i needed?) AND is there a better way? I'm thinking i could try ddrescue, but then i'd need to find out where these files are on disk first..

    If you can't find any utilities that work, try this:
    1. Create a few new .srm files, open them in a hex editor, and figure out what the header looks like (binary files usually start with something fairly identifiable so that e.g. zsnes knows it's looking at a proper .srm file).  If you're even luckier, the file might even contain the ROM name or say, the name you gave your character, as plain text.
    2. Open the raw disk in a hex editor, and search for the header you figured out in step 1.
    3. Copy out the data starting at the point you figured out in step 2, for the length an srm file is for a Legend of Zelda save (look at the files you made in step 1).
    4. If you're lucky, the first one will work.  If not, rinse and repeat.  Depending on how much you figured out in step 1, you may end up having to copy over every .srm file to find the right one.  If you're unlucky, the file you're looking for could be corrupted, or if it's bigger than the block size of the drive (like hbekel said I think 4kB is a pretty typical value), it may be stored on non-consecutive blocks, in which case you're out of luck short of finding a tool that works.
    I don't have any experience with hex editors in linux, although at first glance "hexedit" seems up to the task and is in the arch repos.
    EDIT: I second hbekel's advice to image the drive ASAP in case it's a hardware failure.
    Last edited by redden0t8 (2011-03-25 18:37:44)

  • Extracting class files of a certain package from a jar.

    Hi,
    I want to extract all the class files belonging to a certain package from a JAR file containing class files belonging to a different packages.
    Can I do this using the jar tool, or use some other unzipping tool?
    If it is best to use an unzipping tool which one can I use for windows?
    Thanks,
    Niranjan.

    jar xf file.jar path/to/dir
    For more info see http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/jar.html.

  • How can I extract certain pages from my document and save as another file?

    How can I extract certain pages from my document and save as another file?

    You would need Adobe Acrobat to do that, not Adobe Reader.

  • Batch file extracting all files from nested archives

    I have managed to leverage a powerful
    forfiles command line utility with the mighty
    7z compression program.
    Below is a simple batch file extracting all files from nested archives hidden at any depth inside other archives and/or folders. After the extraction each archive file turns into a folder having the archive file name. If, for example, there was an "outer.rar"
    archive file containing nothing but an "inner.zip" archive with only "afile.txt" inside, "outer.rar" becomes "...\outer.rar\inner.zip\afile.txt" file system path.
    @echo off
    rem extract_nested_archives.bat
    move %1 "%TMP%"\%2
    md %2
    7z x -o%1 -y %TMP%\%2
    del "%TMP%"\%2
    for %%a in (zip rar jar z bz2 gz gzip tgz tar lha iso wim cab rpm deb) do forfiles /P %1 /S /M *.%%a /C "cmd /c if @isdir==FALSE extract_nested_archives.bat @path @file"
    ARCHIVES ARE DELETED DURING THE EXTRACTION! Make a copy before running the script!
    "7z.exe" and "extract_nested_archives.bat" should be in folders available via the %PATH% environment variable.
    The first parameter of extract_nested_archives.bat is the full path name of the archive or folder that should be fully expanded; the second parameter is just the archive or folder name without the path. So you should run "c:\temp\extract_nested_archives.bat
    c:\temp\outer.rar outer.rar" from the command line to completely expand "outer.rar". "c:\temp" must be the current folder.
    Best regards, 0x000000AF

    Incredibly useful!  Thank you so much.  I did make a couple of small changes to make the script a little easier to use from the end-user perspective.
    First - I don't like making the user input the redundant second parameter, so I added this snippet which extracts it from the first parameter.  The first line of the snippet enables delayed expansion so that special characters in our file name don't
    break anything.  The second line pulls the parameter into a variable, and the 3rd line uses delayed expansion on that new variable.  Before implementing delayed expansion I had problems with file paths which included parentheses.
    SetLocal EnableDelayedExpansion
    Set SOURCE=%1
    For %%Z in (!source!) do (
    set FILENAME=%%~nxZ
    set FILENAME=%FILENAME:"=%
    Anyway once that was done, I just used %FILENAME% everywhere in the script instead of
    %2 (making sure to correct quotes as needed)
    This way, to run my script all you need to run is:
    C:\temp\extract_nested_archives.bat C:\temp\Archive.zip
    Second - I didn't want to modify the Windows environment variable.  So I replaced
    7z with "%PROGRAMFILES%\7-zip\7z.exe"
    I also replaced extract_nested_archives.bat with "%~f0" (which represents the full path+filename of the current script).
    Here is my full script now.  Tested on Windows 8 with the 64-bit version of 7-zip installed:
    @echo off
    Setlocal EnableDelayedExpansion
    Set source=%1
    For %%Z in (!source!) do (
    set FILENAME=%%~nxZ
    set FILENAME=%FILENAME:"=%
    move /Y %1 "%TMP%\%FILENAME%"
    md "%FILENAME%"
    "%PROGRAMFILES%\7-zip\7z.exe" x -o%1 -y "%TMP%\%FILENAME%"
    DEL "%TMP%\%FILENAME%"
    for %%a in (zip rar jar z bz2 gz gzip tgz tar lha iso wim cab rpm deb) do (
    forfiles /P %1 /S /M *.%%a /C "cmd /c if @isdir==FALSE "%~f0" @path @file"

  • Extracting .s2p files from 8722A Network Analyzer?

    Hi,
    I wish to extract .s2p files from my HP 8722A Network Analyzer.
    I could not find a driver for it. It is connected to my computer over GPIB.
    I am quite new to this, so if anyone could explain the overall process to extract .s2p files from a network Analyzer, that would be much appreciated.
    I imagine that one takes a measurement, stores it under a certain filename, then a command retrieves it and sends it to the computer?
    Thank you so much,
    Nicolas
    Solved!
    Go to Solution.

    Nicolas,
    Instead of extracting the .s2p files, which because of the age of the device (manual I found said 1991), could be very difficult, I think we would be better served communicating with the device directly and not using the files it creates. Instead of the process you described, we could set it to take a measurement, send the measurement to the computer, and have the computer do any manipulation/saving it may need.
    This manual discusses the basics of communication over GPIB with that device in chapter 12:
    http://cp.literature.agilent.com/litweb/pdf/08720-​90135.pdf 
    GPIB communication is typically pretty simple. The computer will just send the device in question the command or series of commands then wait for the response back, much like the GPIB examples in labview (Example finder>>Hardware IO>>GPIB).
    Unfortunately for us, the Agilent website here:
    http://www.home.agilent.com/agilent/product.jspx?c​c=US&lc=eng&ckey=8722A:epsgro&nid=-536900197.53690...
    only has the operating and service manuals, and not the programming reference manual.  You may want to contact agilent to get the programming reference manual, as that will list all of the commands you need to send the device.
    Regards,
    Kyle Mozdzyn
    Applications Engineering
    National Instruments
    Regards,
    Kyle M.
    Applications Engineering
    National Instruments

  • HT4859 Restore certain files from iCloud backup file.

    I have a backup file on icloud for an old ipad.  I want to extract certain files.  How can I access that backup and look at the files so that I can extract certain ones?

    You can't selectively restore from a back up, you need to restore everything or nothing.

  • Extracting .xls file from an FTP site

    Hi there,
    I'm trying to run a DI solution that is extracting a file from a FTP site. DI can see the file but it gives me an error saying that:
    FTP could not transfer file <FTP site/myfile.xls> from host <IP Address>: <>. Please ensure that the FTP relative path for the SAP R/3 working directory is set correctly such that the data file is accessible to the FTP
    Can someone please help with this.
    Thank you.
    Gsecure

    Hi,
    thats SP1 for DS XI 3.2
    I think there is no delta from XI 3.2 to XO 3.2 SP1 what means you have to do a fresh install and upgrade repo.
    But you better doublecheck before but i think there is no delta.
    Regards
    -Seb.

  • Unable to read a .gif file from a jar

    I have made an application which requires some .gif images.
    I packed all the classes and .gif's in a jar file.
    I have used no package statement in files, all are in one folder.
    While retrieving the .gif file from the jar I have used..
    Image img1 = Toolkit.getDefaultToolkit().getImage(ClassLoader.getSystemResource("Lock.gif"));
    ImageIcon i1=new ImageIcon(img1,"No Users");
    but this does not works and throws nullpointer exception.
    I have also tried getClass().getResource() etc.
    But none of the methods are working..
    Plz. help.
    Nimesh

    Is the class that is loading the image contained in a package? If the resource name does not start with a forward slash, it is interpreted as relative to the package of your class(when doing getClass().getResource())

  • 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.

  • I have to extract all files from a hard drive of a macbook pro that is no longer working. All I have to access the hard drive is a PC, is this possible, and if so how?

    I have to extract all files from a hard drive of a macbook pro that is no longer working. All I have to access the hard drive is a PC, is this possible, and if so how?

    You could try Paragon HFS+ for Windows. That would allow you to read and write files from a Mac-formatted drive.
    Clinton

  • How to extract rpt file from .b1px file in SAP B1

    How to extract rpt file from .b1px file in SAP B1

    Hi Trupti,
    You will not be able to export .b1px file without importing in SAP B1.
    Please import .b1px file in SAP B1 and then export .rpt file from SAP B1 one by one.
    Hope this helps
    Regards::::
    Atul Chakraborty

  • How to extract  DB  FILE  FROM NONSAP  SYSTEM  IN BI-7

    how to extract  DB  FILE  FROM NONSAP  SYSTEM  IN BI-7

    hi,
    chk the links for extraction using DB
    Extraction using DB connect
    http://help.sap.com/saphelp_nw70/helpdata/EN/58/54f9c1562d104c9465dabd816f3f24/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c6/0ffb40af87ee6fe10000000a1550b0/frameset.htm
    Extract data from oracle DB to SAP BI 7.0
    Ramesh

  • How to extract single file from multipart zip archives?

    Hello,
    I have a 10 parts of zip files that contains single file. When I extracted these, each program taking an action seperatly to each parts and gave me 10 files in a different folders. In a Windows, it is so simple. Winzip,winrar automaticaly discovering that are the parts of a single file and give me that.
    My question is simple: How to extract single file from a multipart zip/rar archives ?
    I know a way in "Terminal" but it is not comfortable for big parts.

    I tried with UnArchiver but it extracted each file seperately like showen in a photo

  • Reading external xml files from a jar

    Hi,
    I am trying to read an xml file from a jar (which is not present inside the jar ) .
    I am passing the file name as a string (like C:/folder/filename) to the SAXBuilder but it throwing
    unknown protocol: c error.
    i tried using an url , tried using a relative path but to no use.
    Need help in this regard urgently.
    TIA,
    Regards,
    Harsha

    Hi,
    Actually, my application needs to read two xml files , parse it, perform some operation and write
    the result to an output file.
    The names of the two xml files i mentioned, are specified in a properties file as absolute paths. (I even tried converting them to URIs)
    The xml files are in the same directory as the jar ( i dont know if it should matter as i am giving the absolute path).
    The main class reads the names of the files and passes the names as strings to the SAXBuilder.
    This is where i am getting an exception.
    Going by what you said, is it not possible for a java class to read a fie outside of the jar ? Is there no way to do this ? And right now i am not sure of how to go about this or if there's any work around . Any help would be appreciated.
    Kindly reply at the earliest
    TIA,
    Harsha

Maybe you are looking for

  • Loopback adapter not working - can't install Oracle.

    I'm attempting to install 10g on a Win XP box that is not connected to a network. Installation instructions dictate to install the MS loopback adapter before database installation. I installed it, but I can't get the loopback adapter to work. It can'

  • Fatal Error in EXPDP

    Hi Exprts i m using EXPDP to take schema level backup but i get below error my DB Version is Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 and O/S Red Hat Enterprise Linux AS release 3 (Taroon Update 5) please guide me Copyright (c) 2003,

  • Valuation price with user Exit on activity types

    Hi All, Our customer could have different activity cost for different products even if they are processed on the same cost center, same activity type and same activity time. So I wonder whether SAP has valuation price with user Exit on activity types

  • Expressway-e demo license

    Guys, I am trying to run MRA in my lab and I am wondering how I can get a demo license for expressway-e and c demo licenses for the lab. Any ideas?

  • PCUI Text Management ( Text in Bold required)

    Hi, I am working on CRM 4.0. We are maintaining text in transaction so10 and in access class fetching those text and populating in PCUI. Using function module read_text and save_text for this purpose. I am making some of the text as bold in so10. But