Converting a url to a file (opening a url in a jar and changing to a file)

Hello everyone, my title states exactly what I want to do I want to use Url joe = MyClass.class.getResource(file.txt) to make a url which I can turn into a file.
I need to open this location.
Basically I have 26 text files located in a jar file, and all I gotta do is open each file but I cant seem to find out how to do it, thanks a lot in advance
-mark

use getResourceAsStream(String) to get InputStream instead of URL. Then you can use such a stream as normal FileInputStream or any InputStream.
Notice:
this.getClass().getClassLoader.getResourceAsStream("resource"); looks for
resources in "this" class package. If your resources are somewhere else in
classpath use ClassLoader method getSystemResourceAsStream or give full path to resource starting with /.

Similar Messages

  • No longer have a system that can run Freehand but have 1000's of old Freehand files. Can I convert them to something CC can open, like AI?

    I had a graphic design business for 10 years and at the time found Freehand to be the best solution.  Now I'm an InDesign convert but many of the old freehand files I wish I could open and convert to something in CC.  I need to rebuild my portfolio and many of those old Freehand files are great works of art.  I no longer have a system that will run Freehand, is there something I can run that would convert these files to Illustrator or something usable.  I wish adobe would at least make a patch so I can run it on my Mac long enough to get the key files I want.  Anyone have any suggestions or am I just screwed and 10 years of art is gone...

    Your timing is actually good! This plugin was released this month for doing what you need into Illustrator CC:
    Tensai FH>AI Plugins
    As to InDesign, I have been using FreeHandMX to export my files to PDF and trying out these two converters:
    PDF2DTP | Markzware
    PDF to InDesign converter
    The Markzware converter seems better and they have been eager to hear from FreeHand users. Where conversion isn't exact is text and takes some tweaking. Also any problems Illustrator had with converting FreeHand files shows up in InDesign.
    As for running FreeHand on the latest Macs, virtualization with Parallels and Fusion running Snow Leopard is successful and seamless. Also using WIN versions of FreeHand with CrossWeaver and WINE on Mavericks.
    —Mark

  • I have a quicktime movie on a hard drive, and I have the hard drive plugged into my macbook, and the quicktime movie is not opening, its just a black screen. How do I convert it to the right file so I can watch it ?

    I have quicktime movie files on a hard drive, and normally when I plug the hard drive into my computer, I can open the quicktime files and watch them. Now when I am doing it, the quicktime movies are opening up with a black screen. How do i convert it to be in the right format to be able to watch ?

    I plugged my old drive into an identical Vostro and saved my bookmarks per the instructions. Later, when I check the file, it was in html format. While waiting for the replacement laptop to arrive, I put my old (Vostro) hard drive into a case so I could access the files. I have been able to launch web pages from the file bt accessing them through My Documents so I know the file is good. The problem is, I apparently need to convert them into a JSON file in order to use them. There is a set of instructions on the Mozilla/Firefox website but that method does not work.

  • In camera raw how large should I open my raw file before converting it to a TIF file?

    in camera raw how large should I open my raw file before converting it to a TIF file---2736 x 3648 (10.0 MP), 3072x4096 (12.7 MP) or 3840x5120? (19.7 MP).  I want a sharp TIF file.   I'm shooting with an Olympus E-510, 10.0 MP camera?
    thanks - Ken
    [email protected]

    rasworth wrote:
    There is no advantage to saving or opening other than at the native resolution.
    Actually, not entirely true. In the case of Fuji DSLR's you would do better to double the rez in Camera Raw as that matches the interpolation that the Fuji software does in their higher quoted "effective resolutions"(it ain't real resolution mind you but it can benefit certain image types).
    If you know for an absolute fact you need more resolution than the native file has, you really might want to test upsampling in Camera Raw as it has a newly tuned upsample (put in in ACR 5.2) that is an adaptive Bicubic algorithm that is either the normal Bicubic or Bicubic Smoother depending on the size–and that's something even Photoshop can't do.
    But in general unless you know for a fact you need the image bigger (or have a Fuji camera) processing at the file's native size is the most efficient.

  • Hello! I used QuickTime for watch any videos on OS X Mountain Lion, but now, I'm passed to OS X Mavericks and QuickTime, when I open an .avi file, convert this in a .mov file. I'm sorry for my English, I'm French and I don't know speak English very well,

    Hello! I used QuickTime for watch any videos on OS X Mountain Lion, but now, I'm passed to OS X Mavericks and QuickTime, when I open an .avi file, convert this in a .mov file. I'm sorry for my English, I'm French and I don't know speak English very well, but what can I do for QuickTime opens on .avi and doesn't convert to .mov?

    HI GalaxieMusique,
    I'm french too, but I'm going to write this post in english so that everyone may understand it
    I have the same problem in Mavericks, but I'd say, more important, with QuickLook.
    Indeed Quicklook can't read avi movies anymore. Actually it always been the case, but with Perian we were able to fix it. The problem is that Perian is no longer available for Mac OS 10.9....
    I'd assume that our only hope is Apple themselves... It would be nice from Apple to creat an add-on for quicklook to be able to preview the avi movies.
    In regards with quicktime, you can download QuickTime 7 here:
    http://www.01net.com/telecharger/windows/Multimedia/lecteurs_video_dvd/fiches/10 0.html
    and ask all the .avi movies to be played by QuickTime 7 and not QuickTime X (included into Mac OS).
    Sorry for the english, we french people can make mistakes sometimes
    If anyone has a solution for QuickLook, please do not hesitate. This topic is becoming a real mess....

  • Error opening file/URL reference by alias and Administrative limit exceeded

    Hello All,
    Problem:
    SMTP Error: 4.5.0 error opening file/URL reference by alias
    and
    Search failed with: netscape.ldap.LDAPException: error result (11); Administrative limit exceeded
    Here is my configuration:
    Windows 2000 server (without Active Directory)
    SP4
    Iplanet Messaging Server 5.2
    Netscape Directory Server 4.16
    IPlanet Messaging Server 5.2 Hotfix 1.09 (built Jan 7 2003)
    We have a group which we use to flash messages to all the users of the mail server. Till last week it was working fine but now I am not able to send messages to this group <group-name>.
    There are around 800 (Eight Hundred) E-mail id the messaging server and the flashed message is supposed to go to all 800 + users.
    Note: I have another group of 300 users and I am able to send an E-mail to this group of 300 users.
    I am using Dynamic Group for Members list.
    The error message I get while trying to send message to this group is
    SMTP Error: 4.5.0 error opening file/URL reference by alias.
    The corresponding error in mail.log file is
    30-Jan-2004 10:55:21.40 41c.7e4.1098 tcp_intranet J 0 <group-name>@domain rfc822; <group-name>@domain domain (localhost [127.0.0.1]) 452 4.5.0 error opening file/URL referenced by alias: <group-name>@domain
    Now when I construct and Test the LDAP URL from Console, the error I get is:
    Search failed with: netscape.ldap.LDAPException: error result (11); Administrative limit exceeded
    I have increased the various limits but I still get the same error when I send mail to that group or do a LDAP Test:
    The deafult and new limits are:
    Sizelimit: Default 2000 New 10000
    Timelimit Default 3600 New 3600
    Lookthroughlimit Default 5000 New 6000
    The corresponding error entry in access log of slapd is:
    30/Jan/2004:12:19:26 +051800] conn=34 op=213 RESULT err=11 tag=101 nentries=0 etime=2 notes=U
    My search for Administrative limit problem and error opening file/URL error in Sun forum and other groups did get some hits but that did not solve my problem.
    I will appreciate any suggestion/comments.
    Thanks and Regards,
    Maneesh Bisht

    Thanks Jay.
    My problem has been fixed.
    Your suggestion was to increase the lookthrough limit. As you would have noticed in my posting that I had increased this limit to 6000 but that did not solve my problem. Today I increased this limit to 10000. And after that I did not get "administrative limit exceeded" error. Also I do not get "error opening file/URL reference by alias" error while sending E-mail to a particular group of 800+ ids.
    Regards,
    Maneesh Bisht

  • Can someone please convert a CS 5.5 file to idml? Need to open in CS5.

    I need to open a CS5.5 file but need it converted to idml to open in my version of InDesign. Can someone please help?

    Hello,
    Please excuse me for burdening you but could it be possible
    to help me converting a 5.5 indesign file to indesign 5.0 (idml)?
    Thanking you in advance,
    Fokion

  • After converting to numbers I can't open xls files

    I get the following message: "You can't open the application Microsoft Excel because PowerPC applications are no longer supported." I don't see why it wouldn't automatically convert this as my .doc files get coverted in Pages. Does this mean I've lost access to all of my spreadsheets that I created with the Excel???

    If you drag an Excel file onto the Numbers icon, it doesn't open in Numbers?
    The error message you're seeing is because your iMac's been upgraded to the Lion OS, and the Lion OS doesn't support PPC applications.
    You've got a couple of choices:
    1.  You can spend the $100 or so to upgrade to Microsoft Office for Mac 2011, which, by the way, includes a free update to the next version of Office for Mac.
    2.  You can convert all of the Excel files to Numbers.  Be aware, though, that there may be some formatting changes made during the conversion. 
    I'm not at my Mac right now, but there is a way to associate files with a given application. It involves right-clicking the file, choosing Get Info, then changing something in the resulting window.  Unfortunately, I can't provide the exact wording just now.
    I hope this helps.

  • Will Newer Versions of InDesign Still Open/Convert Mac PM 6.5 Files?

    All right, you've convinced me. I can see that holding on to old technology is not a viable long-term solution regarding PageMaker vs. InDesign. Eventually my old PowerMac Quad will fail and not be able to be repaired. At that point I would be forced into an Intel Mac and new software. I have a ton of PageMaker 6.0 and 6.5 files and will need to convert them to a new version of InDesign. I realize PM6 files will not work with InDesign, that I have to do the initial conversion via PM6.5.
    I've studied the PageMaker forum hoping to see if this specific question has been advanced and answered but saw none. If in fact it has been addressed please understand that at least I did try before writing this.
    My question is this: Will all versions of InDesign IE: CS1, CS2, CS3, CS4 or CS5 open PageMaker 6.5 files? Or will I have to go back to InDesign 2.0, copy/convert all the PM6.5 files and then begin the upgrade process? Surely (and hopefully) Adobe provides a direct upgrade path to the newest InDesign version once you have all PageMaker 6.5 files, rather than making you upgrade to each version individually. If Adobe provides a direct upgrade to the latest InDesign product will this policy be true throughout it's product line? I also have older versions of PhotoShop, Illustrator and Acrobat to be concerned with. (I know, I know... the last couple of sentences are not about PageMaker-sorry)
    If anyone can answer this, please let me know so I can plan accordingly. Begrudgingly, I will probably begin the transition to InDesign soon. Looks like I'm in for a long, long study period to get up-to-speed. Bye-bye PageMaker, bye-bye PowerMac, so sad to see you go.

    Chuck, I am not very qualified t
    o answer your questions, but will do my best within my limi
    tations (I am still using InDesign CS3, and I haven't had to work with PageMaker files for years).
    I did open many PM 6.5 files with ID2, and I have just opened a couple in ID3. These two last were rather simple jobs, and opened without a hitch. When I had to open PM files with ID2, I remember some opened flawlessly, most with relatively minor glitches, and some required a lot of work to look the same than the originals. And yes, each version of ID that I have used opens PM files directly; no need to pass from older to newer versions.
    Another thing I remember is that I also had a great number of PM files, which I still keep, but the ones that I have really had (needed) to convert are just a small fraction of them. Maybe you'll live a similar experience.
    As for the learning curve, it surely is there; but in my case, I found it not at all steep, quite the contrary: I was surprised to find how fast I got used to the "new version" of PageMaker. Maybe if I did the move now (to version CS5) I wouldn't find the transition so easy as to ID2. And I know of people who have not found it easy, but don't seem to reacall anyone complaining of how very difficult it was for him/her.
    As for upgrading several products at the same time, you'll have to think carefully what your future needs are really likely to be. You see, Adobe offers a very attractive price for "the whole lot", what they call the Creative Suite. I have however heard many complaints of people who feel they were "trapped" when they followed that route, because when it comes to upgrades, they can only upgrade the whole suite, not each product at a time. So you may be stuck with upgrading products you don't use and think will never use. Sort of what happened with Word and Excel, wich were the basis of MS Office: I understand that nowadays you cannot even buy each product separately, although I may be wrong.
    If I were you, most probably I would upgrade at this time each product separately, keeping in mind that perhaps later it could be better for me to buy the Suite. And regarding this route: Adobe still offers a very convenient upgrade price from PageMaker to InDesign (no choice but the latest version), but nobody knows for how long they will keep this offer. I was one of those who though that when V5 was launched, Adobe would stop selling PageMaker (something that in my opinion they should have done when InDesign appeared), and the upgrade offer would end, but apparently I was wrong on both counts. Just be warned that this particular upgrade offer may be gone any day...
    As for parting with such old and faithful friends, part of the words of a song my grandmother used to sing when I was a child came immediately back to my mind: Un viejo amor no se olvida ni se deja... an old love is never (really) forgotten or abandoned in my free translation, where I use the word "love" with the meaning of "loved person", and the optional "really" I added comes form the rest of the words of the song.
    Hope this helps.
    Initial extra line breaks kindly provided by the software.

  • Minefield just would not open pages, whatever I tries to type in the addressbar the URL just stayed there and nothing happened. Even if I opened a new tab and put a new url again it did not even start loading the page. This is happening since the last upd

    Minefield just would not open pages, whatever I tries to type in the addressbar the URL just stayed there and nothing happened. Even if I opened a new tab and put a new url again it did not even start loading the page. This is happening since the last updates from today or yesterday. I already removed minefield and installed it again
    == This happened ==
    Every time Firefox opened
    == today ==
    == User Agent ==
    Mozilla/5.0 (Windows; Windows NT 5.2; Win64; x64; rv:2.0b3pre) Gecko/20100728 Minefield/4.0b3pre ( .NET CLR 3.5.30729; .NET4.0E)

    Create a new profile as a test to check if your current profile is causing the problems
    See [[Basic Troubleshooting|#Make_a_new_profile|Basic Troubleshooting: Make a new profile]]
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins"
    If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)
    See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    See also http://kb.mozillazine.org/Browser_will_not_start_up
    You can discuss issues with Namoroka 3.6 and Minefield 4.0 nightly and alpha/beta builds at the MozillaZine Firefox Builds forum.
    That forum is better suited to discuss such issues.
    You need to register on the MozillaZine forum site in order to post at that forum.
    See http://forums.mozillazine.org/viewforum.php?f=23

  • How to convert java class to dll file for using in Microsoft Technology(.n)

    hey hemmj !!!!!!
    nice replying , first of all i d like to say thanks for response me so frequently..... i like such type of guy... i d never forget ur online support.
    hey buddy, i ve a problem with applet application...
    i m working on java chat server build on swing applet. As it is chat server, it is divided into two parts, one is server application and other is client application. I want to run this server app on the client server and the basic thing with this site is that it is running on .net platform(Microsoft). and the other app ll running on the client machine or end user. Now the problem is that this site would run only if the server app ll be run on server. This server app ll open the socket of server, which ll listen the request of the user...... So, the requirement is to convert this java sever class file into dll file and register this dll file with the IIS server.So, It run and stop with the IIS server.
    I ve already search the way to convert the java class file into dll file. This is possible in such way........... below code is for the java class file...
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class chatServer
    public static void main(String args[]) throws Exception
                        ServerSocket sersoc=new ServerSocket(1234);// Any port number above 1000 should do
    // as most ports below 1000 are used by system
    Vector socvec=new Vector();
    String data="";int i,j=0;
    BufferedReader in;
    //System.out.println("Listening of port " + sersoc.getLocalPort());
    //System.out.println("Waiting for connections...");
    while(true)
    Socket soc=sersoc.accept();
    socvec.addElement(soc);
    chatServerReadThread csrt=new chatServerReadThread(socvec, soc);
    in=new BufferedReader(new InputStreamReader(soc.getInputStream()));
    PrintStream out=new PrintStream(soc.getOutputStream());
    out.println("Connected to chat server");
    out.flush();
    data= in.readLine();
    for(i=0;i<socvec.size();i++)
    soc=(Socket)socvec.elementAt(i);
    out=new PrintStream(soc.getOutputStream());
    out.println(data + " connected");
    out.flush();
    //System.out.println(data + " connected");
    csrt.start(); // error is comming from here..... plz help me.
    class chatServerReadThread extends Thread
    Vector socvec;
    PrintStream out;
    chatServerReadThread(Vector socvec, Socket soc)
    this.socvec=socvec;
    try
    out=new PrintStream(soc.getOutputStream());
    }catch(Exception e){}
    public void run()
    try
    String data;
    Socket soc;
    BufferedReader in;
    while(true)
    for(int i=0;i<socvec.size();i++)
    soc=(Socket)socvec.elementAt(i);
    in=new BufferedReader(new InputStreamReader(soc.getInputStream()));
    if(in.ready())
    try
    data=in.readLine();
    if(data.charAt(0) == ']')
    data = in.readLine() + " exited";
    //System.out.println(data);
    socvec.removeElement(soc);
    for(int e=0;e<socvec.size();e++)
    soc=(Socket)socvec.elementAt(e);
    out=new PrintStream(soc.getOutputStream());
    out.println(data);
    out.flush();
    else
    for(int e=0;e<socvec.size();e++)
    soc=(Socket)socvec.elementAt(e);
    out=new PrintStream(soc.getOutputStream());
    out.println(data);
    out.flush();
    }catch(Exception e){socvec.removeElement(soc);}
    }catch(Exception e){e.printStackTrace();}
    first i ve made the jar file of this class
    jar cvf chatServer.jar chatServer.classafter getting the jar chatServer.jar. I ve opened the .net dos prompt and
    type this command which ll make dll file automatically....
    > jbimp /t:library chatServer.jar
    And you'll see the following output:
    Microsoft (R) Java-language bytecode to MSIL converter version 1.1.4322.0
    for Microsoft (R) .NET Framework version 1.1.4322
    Copyright (C) Microsoft Corp 2000-2002. All rights reserved.
    Created chatServer.dll
    I cant get the problem origin from where it is comming, when i tried to convert it into .dll file it shown an error that, it did not recongnized the method in first class
    public static void chatServerReadThread.start() method
    is not recognized by .net dos prompt commnad. But when i omit this method it gets created the .dll file. This start method is basically the default method of thread class that run the thread from the same class..
    By vewing the code u can visulize the thing,, i ve marked the code from where the error is comming.
    Plz do it as soon as possible, i ll waiting for ur reply......
    I ll be really thanking u for that....
    Thanx and regards
    Niraj Kumar Singh

    I wonder if this will work:
    jbimp /t:exe chatServer.jar
    Your chatServer is an application that can be started from the commandline.
    A dll is a library to be used in com, com+, other executables or ....

  • How to convert Labview 9.0 vi files to 7.1 vi files?

    Hi, I have a set of LabView 9.0 .vi files that I need to convert to 7.1 .vi files, but the current LabView 9.0 version only allows me to save it to 8.0 version. Thus, my questions are:
    1) Can a user with LabView 7.1 open 8.0 files?
    2) If not, is there any other way to convert 9.0 files straight to 7.1 files?
    Many thanks!
    Solved!
    Go to Solution.

    It requires two steps.
    You need to open the VI's in LV 2009 and do a Save for Previous version back to LV 8.0
    Then open that in LV 8.0 and do a Save for Previous back to LV 7.1. 
    If you don't have LV 8.0, then you can post the files to the downconvert thread and request there that they be converted to LV 7.1

  • When i try to load any page on Mozilla 28 the page opens but i get additional tab saying The address isn't valid The URL is not valid and cannot be loaded.

    When i try to load any page on Mozilla 28 the page opens but i get additional tab saying The address isn't valid The URL is not valid and cannot be loaded. I tried everything from reseting Firefox ,completely new installation of firefox to about.config and nothing worked it's been two days now since the problem started and i am pretty frustrated and desperate as i try to fix the issue so please help me with some solutions????
    Big thanks in advance

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Delete a possible user.js file and numbered prefs-##.js files and rename (or delete) the prefs.js file to reset all prefs to the default value including prefs set via user.js and prefs that are no longer supported in the current Firefox release.
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder)
    *http://kb.mozillazine.org/Preferences_not_saved

  • When we connect to the internet or visit a new web page, a new tab opens and an alert pops up as follows: "The URL is not valid and cannot be loaded"

    When we start the internet or navigate to a new page, a new tab opens with the following alert: "The URL is not valid and cannot be loaded." We "x" out of it, but a new tab, with the same alert appears. The problem occurs again when we try to navigate to another web page. A real nuisance. We've scanned the computer but found nothing but Adware cookies.
    == This happened ==
    Every time Firefox opened
    == 5/20/10

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • Adobe DNG Converter can't recognize any files

    Hi All!
    I'm new here and would very  much appreciate help.
    I am running a Mac OS X 10.04.11 and would  like to open .CR2 files (native file from my Canon 500D) in PS4      / Bridge  CS4. My problem is that although I have downloaded the Adobe DNG Converter and Camera Raw 5.1  update as described  here: http://www.adobe.com/support/downloads/detail.jsp?ftpID=4057,  the DNG Converter can't recognise any files at  all (they are greyed-out  when I go to select any folder). I also followed these steps from the aforementioned link (well at  least I hope I did it right, I found the reference to step 4 slightly  confusing):
    To install with Adobe Creative  Suite 4 or Photoshop CS4:
    Automated installation on Mac or Windows®:
    1. Select "Updates..." from the Help menu
    2. Follow the on-screen dialogs to download and  install the latest  available Camera Raw update  
    Manual installation on Mac:
    1. Exit Photoshop CS4 and Adobe Bridge.
    2. Open the Finder.   
    3. Navigate to the root of the local disk (not the user's home  folder).   
    4. Navigate to: (Please read directory carefully)
    Library/Application Support/Adobe/Plug-Ins/CS4/File Formats
    5. Move the existing plug-in to another location (for example, a new  folder on your desktop). Ensure you keep this version in case you need  to revert back.
    6. Copy the Camera Raw plug-in, Camera Raw, from the download  into the same folder as in Step 4.   
    7. Launch Photoshop CS4 or Adobe Bridge.   
    Is that version the right one for CS4?
    Only Finder and the Canon Software can preview my .CR2  files, Photoshop still gives the message: "Could   not complete  your request because Photoshop does not recognise this  type of file." and   Bridge only shows me a generic RAW thumbnail. This message also  appears in PS when I double-click on the  Camera-RAW.plugin. I also  restarted my computer,  but that didn't fix it.
    Can  anyone help me out please? I'd urgently need a solution.
    Thanks in advance!

    I now uninstalled the older 5.1 version and  instead installed the DNG Converter 6.3 separately and it works  perfectly.
    About the Camera Raw 5.6 update: I also downloaded the plug-in  (which I think should be the last version CS4 supports) and can now open  my .CR2 files in PS, Bridge previews them too. :-)
    Is it advisable to keep both, .CR2 as well as .DNG files? Why is it  that my .DNG files are lighter than the native .CR2?
    Thanks again!

Maybe you are looking for