Find Cache Directory Path

Is it possible to find the webstart cache directory path using java webstart API.
Thanks

- Put the HTML in a jar archive
- Reference the jar in the JNLP
- Access it using getResource() and..
- Display it in a JEditorPane
(fine for simple and valid HTML)
Alternately, if you intend to show the page in a
browser, and want to have a sandboxed applet,
you might..
- ask the user where they want to save the HTML
(via the FileSaveService)
- save it there.
- store the full path of the downloaded HTML using
the PersistenceService*
- load it, when required, using the FileOpenService.
It might pay to explain to the end user that this
file is used regularly and it makes sense to tick
the 'always allow' box for 'ease of later use'.
* Only necessary if you want to cache the HTML
between runs, obviously.

Similar Messages

  • Finding the directory path in java

    I need to check if a file exists or not before an action is taken. I used File class to get the handle of a file and and then used exist() function to check if it is there. But this function needs to full path to that file. I need to find a directory path at runtime as the application is deployed in different environment and wouldn't know the directory path in each environment. Could somebody help me on this. Thanks,

    fBut this function
    needs to full path to that file. I need to find a
    directory path at runtime as the application is
    deployed in different environment and wouldn't know
    the directory path in each environment. Well, that can only you know where this file is on the different platforms. So maybee you can provide it as a user-input, a parameter to the program or be set in a settings-file which the program reads.
    If you want the full path to the current directory where the java program runs, this works:
    File f=...;
    String absPath=f.getAbsolutePath();
    File absPathFile=new File(absPath);Gil

  • Finding the directory path

    i'm not sure what is the best way to determin th epath (location) of a directory or a file.
    example (IDE enviroment)
    [app]
       |----[config]
       |           |---- log4j.properties
       |           |---- application.properties
       |
       |----[classes]  
       |           |---- MyApp.classesexample: deployment
    [app]
       |----[config]
       |           |---- log4j.properties
       |           |---- application.properties
       |
       |----myapp.jar   (excutable jar file)
       |----START.BAT file
       |----STOP.BAT fileSTART.BAT
    java -jar myapp.jar
    public class MyApp{
        public MyApp(){
            String path = MyApp.class.getResource("/").getPath();
            System.out.println(path.replaceAll("%20", " "));
    }in the IDE, i have noo problem with the String path = MyApp.getResource();
    i think this is because the working directory is [classes]
    if i run from the "deployment using a jar file...i would get NULLPointerException
    the getResource would return null
    this is because the working directory is [app]
    Is there a way to get the location of the MyApp class (where the working directory should not matter)?

    i think i see the problem:
    the MyApp is in a jar file...and MyApp is not in a package;
    therefore getResource("/") // look for the directory that MyApp is in
    iwould return null...since it's (technically) not in any directory - no package specified
    am i correct?

  • How do you set/find the directory path for /i/

    Searching the forum, I found one note that indicated this was set in MARVEL.CONF (since I'm running 2.0, presumably DADS.CONF). However, looking at the DADS file for my install, I don't see anything resembling a directory mapping. What would the syntax be for this?

    In a default installation, you are supposed to add the mapping to httpd.conf
    But it could be in any file Apache includes.
    Seach for a line like
    Alias /i/     "/opt/oracle/product/10.1.0/Apache/Apache/images/"

  • How to get the path of the cache directory ?

    Hi everyone,
    I need to get the path of the cache directory to copy files into it (these files are security files that are necessary to encrypt data).
    Maybe there is a jnlp.jar to have object that implements a method getCachePath() ? But I can't find it.
    Any ideas ?. thanks.

    you can find the cache location by finding the location of the jar file you are running from:
    URL resource =
    this.getClass().getClassLoader().getResource("testResource");
    if (resource != null) {
    String s = resource.toString();
    if (s.startsWith("jar:")) {
    int index = s.indexOf("!");
    if (index > 4) {
    String fileurl = s.substring(4,index);
    if (fileurl.startswith("file:")) {
    String path = fileurl.substring(5);
    // now path is the path to the jar file in the cache containing the resource
    /Dietz

  • How To Find Oracle Home Directory Path...

    Hello,
    I am working on deployment of java web service on Oracle Application Server(LINUX) 10g, EBS - R12.
    I am working on other system and i want to deploy web service remotely on application server.
    And i am not getting the oracle home directory path. I want to find the home directory path remotely.
    so suggest me how to find out path of that.
    or weather i have to install jdevloper on server system and than i have to deploy it,
    or any other alternative way is available.
    Reply as soon as possible......

    Thanks for your reply.
    It's precisely the registry key which got tampered, and there's no ORACLE_HOME environmental variable(Or that too is tampered)
    Now,how to set it to one of the Oracle home directories?
    Regards,
    Bhagat
    !!!!!!!!!!!!!!!!!!!!

  • What is it directory path and where do i find it??

    i am about to publish my website made with i web and i cant find path directory HELP

    Files are normally uploaded to the root folder and, in this case, the Directory/Path field should be left empty....
    http://www.iwebformusicians.com/iWeb/Publish-Website.html
    Also, there are different ways to upload the files ....
    http://www.iwebformusicians.com/iWeb/URLs-Favicons.html

  • My iWeb can't find directory/path at GoDaddy

    I can't make a test connection via the FTP on iWeb's publish page. Keeps saying "the directory/path couldn't be found. Verify your settings and try again."
    I've searched the forum here and called GoDaddy for help. The tech there told me that I'm making a connection but my software can't find the "root folder" at my domain.
    Help?????

    I'm gonna answer my own question/problem in case anyone else encounters the same.
    Instead of publishing to FTP service, I published to a folder on my computer. Then I was able to manually upload the files, like I'd been doing in the past, using the GoDaddy FTP service. Mission accomplished.

  • Help with writing to the JWS cache directory?

    We have a java application named "foo" that we would like to deploy via Webstart. The original version of foo is packaged into a single foo.jar archive. Foo creates a textfile "info.txt" outside of foo.jar. "Info.txt" stores information that we would like to remain constant for each client machine, which is why we are not wrapping this info inside foo.jar b/c "foo.jar" is overwritten each time a new version is available on the server.
    When running "java -jar foo.jar" outside of Webstart, foo works correctly and generates "info.txt" in the same directory where foo.jar is located. The current directory is determined by this code snippet--
    File infoFile = new File ( "info.txt");
    However, when we deploy "foo.jar" through Webstart, foo fails to work properly on the client machine b/c it is unable to write "info.txt" in the directory where "foo.jar" has been downloaded and cached. Note that we have signed foo.jar properly and it is allowed to write to the local filesystem. But instead of generating "info.txt" in the same location as "foo.jar", it creates "info.txt" on the client desktop causing problems with the running application.
    Can anyone tell us how to capture the client's cache directory location during Webstart download so that "info.txt" can be created and placed in that directory?

    you can find the path to the cache directory by getting a jar url to one of your resources in the cache:
    URL jarURL = this.getClass().getClassLoader().getResource("MyClass.class");
    String jarFileStr = jarURL.getFile();
    1.) first remove the "!/MyClass.class":
    jarFileStr = jarFileStr.substring(0, jarFileStr.length() - "!/MyClass.class".length());
    2.) then remove the jar://file: in front:
    if (jarFileStr.startsWith("jar://file:") { jarFileStr = jarFileStr.substr(11); }
    3.) may need to transform %20 to spaces, and forward slashes to File.seperator
    jarFileStr.replace("%20", " ");
    This gives me a string value of:
    file:C:/Documents%20and%20Settings/glyn/.javaws/cache/http/Dgwwinxp/P80/DMlive/DMjava/RMBBClient.jar
    When I try to do:
    File jarFile = new File(jarFileStr);
    JarFile jar = new JarFile(jarFile);
    I get java.util.zip.ZipException: The filename, directory name, or volume label syntax is incorrect.
    Has anyone got this method of getting the jar file to work?
    Thanks
    Glyn
    Re: Java Web Start getResource() issue
    Author: dietz333
    In Reply To: Re: Java Web Start getResource() issue      Sep 29, 2003 10:18 AM
    Reply 5 of 8
    Glenn:
    the string - file:C:/Documents%20and%20Settings/glyn/... is not legal path.
    1.) first you need to strip off the "file:"
    2.) you need to change the '/' to '\' (on windows).
    use str.replaceAll("/", File.separator)
    /dietz
    Re: Java Web Start getResource() issue
    Author: gdub
    In Reply To: Re: Java Web Start getResource() issue      Sep 30, 2003 9:29 AM
    Reply 6 of 8
    Thanks for the reply.
    I changed the line to
    jarFileStr = jarFileStr.substring("file:".length(), jarFileStr.length() - "!/com/xxxx".length());
    File file = new File(jarFileStr);
    The System.out of file is
    C:\Documents%20and%20Settings\glyn\.javaws\cache\http\Dgwwinxp\P80\DMlive\DMjava\RMMyApp.jar but isExists() returns false on the file.
    I guess it doesn't like the %20 etc. because that it the path to the file alright..
    Re: Java Web Start getResource() issue
    Author: gdub
    In Reply To: Re: Java Web Start getResource() issue      Sep 30, 2003 9:33 AM
    Reply 7 of 8
    This works:
    jarFileStr = jarFileStr.substring("file:".length(), jarFileStr.length() - "!/com/xxxx".length());
    jarFileStr.replaceAll("%20", " ");
    File file = new File(jarFileStr);
    Not very pretty. But it will do me for now.
    Thanks for your help.
    Re: Java Web Start getResource() issue
    Author: josephconder
    In Reply To: Re: Java Web Start getResource() issue      Oct 3, 2003 1:43 PM
    Reply 8 of 8
    I ran into this problem as well. The string is URL encoded (hence the %20=space).
    You could use URLDecoder.decode(jarFileStr) to get the same result (and not worry about any other encoded characters).

  • Problem with Java keystore and certificates (unable to find valid cert path

    Our program is made so that when a certificate is not signed by a trusted Certification Authority, it will ask the user if he/her wishes to trust the certificate or not. If they decide to trust the certificate, it will accept the self signed certificate and import it into the keystore and then use that certificate to log the user in. This works fine. It will import the certificate into the keystore and use the specified ip address to establish a connection with the LDAP server (Active Directory in our case) and authenticate properly. However, the problem arises when we then try and connect to a different ip address (without restarting tomcat, if we restart tomcat, it works fine...). It imports the certificate into the keystore fine, but always gives the exception
    "Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"
    and does not authenticate with our LDAP server (which is Active Directory). The problem seems to be that it is no longer looking at the System.setProperty("javax.net.ssl.trustStore", myTrustStore);
    I have tried multiple times to just reset this property and try and "force" it to read from my specified trust file when this error happens. I have also imported the certificates directly into the <java_home>/jre/lib/security/cacerts and <java_home>/jre/lib/security/jssecacerts directories as the java documentation says that it will look at those directories first to see if it can find a trusted certificate. However, this does not work either. The only way that I can get this to work is by restarting tomcat all together.
    If both of the certificates are already in the keystore before tomcat is started up, everything will work perfect. Again, the only problem is after first connecting to an IP address using TLS and importing the certificate, and then trying to connect to another IP address with a different certificate and import it into the keystore.
    One of the interesting features of this is that after the second IP address has failed, I can change the IP address back to the first one that authenticated successfully and authenticate successfully again (ie
    I use ip 1.1.1.1, import self signed certificate, authenticates successfully
    login with ip 2.2.2.2 import self signed certificate, FAILS
    login again with 1.1.1.1 (doesn't import certificate because it is already in keystore) successfully authenticates
    Also, I am using java 1.5.0_03.
    Any help is greatly appreciated as I've been trying to figure this out for over a week now.
    Thanks

    Please don't post in threads that are long dead and don't hijack other threads. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
    I'm locking this thread now.

  • Firefox won't open following update. Can't open Profile Mgr, even when using entire directory path in cmd line

    I'm running Firefox on a Windows 7 machine. Firefox won't open following the latest update. I've read the help articles and it seems like I need to create a new profile because my settings have likely been corrupted. I'm unable to open Profile Mgr, even when using entire directory path in cmd line. I've tried the following commands in the command line:
    firefox -p
    "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -p
    Nothing happens with either command.
    I'm also running Norton Internet Security. I read a help article Re Virtual Browsing features possibly causing a problem. The article said to check the virtualization setting in the internet security software and to clear the virtual cache. I went thru all of the settings menus in Norton Internet Security version 21.6.0.32 and I didn't see anything that looked like 'virtualization" settings, so I assumed that this doesn't apply to me.
    If you have any ideas, I'd sure appreaciate your expertise!!

    ''arcandl [[#question-1038482|said]]''
    <blockquote>
    I'm running Firefox on a Windows 7 machine. Firefox won't open following the latest update. I've read the help articles and it seems like I need to create a new profile because my settings have likely been corrupted. I'm unable to open Profile Mgr, even when using entire directory path in cmd line. I've tried the following commands in the command line:
    firefox -p
    "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -p
    Nothing happens with either command.
    I'm also running Norton Internet Security. I read a help article Re Virtual Browsing features possibly causing a problem. The article said to check the virtualization setting in the internet security software and to clear the virtual cache. I went thru all of the settings menus in Norton Internet Security version 21.6.0.32 and I didn't see anything that looked like 'virtualization" settings, so I assumed that this doesn't apply to me.
    If you have any ideas, I'd sure appreaciate your expertise!!
    </blockquote>
    ''philipp [[#answer-670108|said]]''
    <blockquote>
    hello arcandl, when firefox isn't launching after you double-click on the shortcut this is sometimes also a sign of malware being active on a system.
    you might want to try running a scan with some different other security tools like the [http://www.malwarebytes.org/products/malwarebytes_free free version of malwarebytes] and [http://www.bleepingcomputer.com/download/adwcleaner/ adwcleaner] which are specialised in removing adware and browser hijackers.
    [[Troubleshoot Firefox issues caused by malware]]
    </blockquote>
    Phillip - You're a genius!!! I ran malwarebytes and it resolved my problem. Thank you so much!!!

  • UTL_file Procedure- some error on invalid directory path

    Hi,
    I Created a file procedure...but while executing a procedure its showing directory Error....
    Find the solution and post it...
    Heading 2: h2. ERROR -29280ORA-29280: invalid directory path
    create or replace
    PROCEDURE HELLOFLE IS
    v_MyFileHandle UTL_FILE.FILE_TYPE;
    BEGIN
    v_MyFileHandle := UTL_FILE.FOPEN('C:\','HELLO.TXT','a');
    UTL_FILE.PUT_LINE(v_MyFileHandle,'Hello World! ' || TO_CHAR(SYSDATE,'MM-DD-YY HH:MI:SS AM'));
    UTL_FILE.FCLOSE(v_MyFileHandle);
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERROR ' || TO_CHAR(SQLCODE) || SQLERRM);
    NULL;
    END;

    This is the spec of fopen:
    UTL_FILE.FOPEN (
       location     IN VARCHAR2,
       filename     IN VARCHAR2,
       open_mode    IN VARCHAR2,
       max_linesize IN BINARY_INTEGER)
      RETURN file_type;
    Location is not "c:\" but a directory object name. See the pl/sql manual:
    http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/u_file.htm

  • Finding the exact path of a file using a Java program

    Can anyone tell me how to find the exact path of a file which is saved in a directory other than the one in which the main file is saved? I know there is a class called File which has many methods like isAbsolutePath() and isPath() but they return the path in which the main class is located

    actually i m trying to write a program which will
    take a name of a file or a directory from the console
    and it should give the entire path of that file or
    directory and this file need not be stored in the
    path of the main class.....It can be stored in any
    drives of my PC....Ok, then the console input needs to be an absolute path or a path relative to some given directory (usually the one from which the application is started). Java cannot magically guess absolute paths if you just provide a file name. E.g. if I'd use your program and would provide as input "build.xml", how should the program know which file by that name I mean (there are lots of build.xml files in different locations on my machine)?

  • Why are files in Firefox 33 cache directory different size than saved files on desktop

    In previous versions of Firefox I used the cache directory to extract videos, flash files and hidden images, that were not saved in folder and a HTML Document file on desktop. For Example the opening image of a YouTube Video can not be extracted and saved from Firefox but is stored in the cache directory.
    To find these files without going through them one at a time, I would copy the cache folder on a desktop folder and then use Double Killer to delete the same size files in both the cache and the saved files in the desktop file folder. The files that are left behind in the cache folder are those that did not save to the desktop file and folder. I can then double check to see if I can find the videos, flash or images from the remaining files.
    I have updated to Firefox 30.0.3. The problem now is that the files in the cache are different in KB size from the saved files on the desktop folder. The dimensions of a saved image are the same but the size of the file differ. Now I can not use Double Killer to delete files and have to go through the whole cache directory one by one to find files that were not saved.
    Why did the Firefox developers changed the cache directory? Do I need to revert to a previous version of Firefox or is there a way that I can change the cache directory of Firefox 33.0.3 and the size that it stores files.
    Would also like to know what add-on gives the best quality screenshot with flash.
    Thanks for this support. Apart from this cache problem I find Firefox easy to use and the best web browser.

    Current Firefox 32+ releases use a new cache service named Cache2 and this cache service works differently.
    Files in the cache2 folder are special files that also store the meta data apart from the actual file data that you see on the about:cache page if you click an item.

  • "updating cache directory" runs forever in Mac Mail plus other ills

    Running 10.9.2 on MacMini with 16 gb ram.  Mail version 7.2.  Using SpamSieve
    Using my IMAP account...which has 3450 messages in the combined five folders for five different mail accounts.   The folder having the problems below that are folder specific has 2000 messages in it.
    Activity shows "Updating cache directory"  "evaluating message x out of 256"  Oddly, the number is usually 256.  It runs through 256 and then starts over again, on and on.  It eventually stops.
    It also has great difficulty deleting mail.  I delete it using Erase Deleted Items. Deleted mail is delivered again and again when the app goes to the server.  Often it is Spam that I have deleted after SpamSieve put it in the Spam folder (which is "On my Mac").
    I often have the "Can't move mail to x folder".  When I rebuild, it fixes that, but the problem comes back in a day or so.
    The appd fails to pickup all the mail unless I Take All Accounts Offline and then go back online.  Even then, it finds more mail if I Quit mail and then immediately restart it. And sometimes when I do that it brings back mail that I recently deleted.
    If I use Show Deleted Messages, after I delete, the headers still show up in the Inbox, but themessages are unavailable (which is to be expected).
    I have deleted the preference folder in Mail library before and it simply redownloaded everything, but didn't change its behavior.
    Wisdom would be appreciated in how to fix these issues.
    Thank you, in advance.

    I finally had to get FuseMail to "reset the IMAP flags" on their end and everything seemed to resolve itself.

Maybe you are looking for

  • BPC Script logic : WHEN condition on two members of the same dimension

    Hello experts, my particular need is the following one ; I have to write an initialization logic for a planning application but I have to match 2 conditions to perform the initialization : (dimensions are PERIOD / RATIO and few other not interesting

  • Problem with Web Intelligence Rich Client - text is cropped

    Hello I have the following problem when I use Web Intelligence Rich Client. When I try to display a fairly long field (4000+ characters), the text gets cropped at the end of the page and at the start of the next one. Here's a link to what it looks li

  • Iphoto export organization

    Is there a way to export all the photos from my Iphoto app onto an external drive, yet still keep them organized in events by date like they are in Iphoto?

  • App wont complete or go away

    Woops looks like whatever I just typed didn't go anywhere, it just took me to this form. So anyway, I tried downloading an app straight from my iPhone (4) and it did not complete. I resumed & completed the download from iTunes but that half-done app

  • Oracle 10.2.0.4 on SAN Storage.

    Hi Experts, I am in the process of installing new Oracle 10g database for my production database which is a part of upgrade, on HP SAN storage with RAID5. We run oracle apps 11i and this is also going to upgrade to R12. My concern is how shall i put