What is the best strategy to save a file in client computer

I want to save some information in a file in client computer. What is the best strategy to do? There are some ways I can think about. But none of them is good enough for me.
1. I gave all-permission. So, I can actually write what I want. But, in order to make the program runs on all platform/all client computers, I can't make any assumptions on file system of client computer. So, this is not good.
2. I can write a file into .javaws directory. But, how can I get file path for this directory? JNLP API does not give this path to us. I can't think a way to get this path for all client computer (WIndown, Mac, Unix).
3. To write as a muffin. Seems fine. But, I often change server and path. So, once I changed server, the client will loss the file saved since muffin is associated with server and path.
4. I can just open one file with on path. I think J2SE will treat this file platform dependently. For example, for W2K this file will be put into Desktop. This is bad.
Any better idea?

In the past I have used the Properties class to do things like this. Using load and store, you can read and write key=value pairs.
I store the file in the user.home directory. You can use System.getProperty("user.home") to get this location.
No guarantees, but I thought that this user.home property was good for any OS with a home directory concept. If that turns out not to be true, maybe the System property java.io.tmpdir would be more consistent across platforms. This, of course, would be subject to delete by the OS/administrators.
-Dave

Similar Messages

  • What is the Best Format to Save Photo Files?

    When I open and edit photos from my digital camera in Photoshop, is it best to always save it as a .PSD as I go?  I read that a JPEG will lose quality each time I re-save...is this also true of a .PSD?
    Also, I'm trying to use some photos on a web-page's slideshow, and that web site recommends using "Saving For Web" at 72dpi in Photoshop so it can be viewed at it's best quality.  I tried "Saving for Web" but did not see where to choose the 72dpi setting.  How do I do this?
    By the way, I'm using Photoshop Elements 6.0

    Save For Web always exports with a 72 ppi resolution. All you need to worry about is the image size, quality, and format. BTW, you should save with a different name as you don't want to overwrite your files with a 72 ppi resolution which looks good on monitor but is NOT good for printing.
    There's a video about using Save For Web here:
    http://www.photoshopsupport.com/elements/tt/save-for-web.html
    Tutorial for it here:
    http://graphicssoft.about.com/od/pselements/ig/documents.--70/More-Save-for-Web-Controls.h tm
    Adobe Help page here:
    http://help.adobe.com/en_US/PhotoshopElements/6.0/help.html?content=WSCC0C7B37-3AD2-43ca-9 BF0-677BFC551D97.html
    Personally, I always work on a copy of my original as I want to keep the original in case I decide to redo it at some point...maybe my retouching skills improve, I simply change my mind, or maybe there's a technology improvement down the line like better noise reduction or maybe some sort of anti-blur fix (Okay, I'm a dreamer...)
    PSD files are non lossy...meaning you do not lose quality when they are resaved. JPGs are a lossy format meaning you do lose quality. Personally, I keep my originals and keep my wk in progress in PSD. I only save to JPG when completely done if needed.

  • What is the best way to save iMovie Events?

    I would like to save iMovie Events for future use but the files are so big that I need to have several external hard drive. What is the best way to save these files? Burn to DVD discs?

    mihomle wrote:
    .. but the files are so big that I need to have several external hard drive. .. Burn to DVD discs?
    1 TB of harddrive space actually <60€ .. drag'n drop files, done. instant access for future projects.
    1 TB of DVD disk space (4.4GB x 230 pieces, each ~50¢) = ~115€ + hours of work .. hours of re-importing in future use ...
    => I prefer ext. HDD.. 1TB fits ~ 75h miniDV, or 40-60h HiDef imported (using the 'Archive' feature of iM09 much more) ..

  • I have lightroom 5.7. Now I have apple TV to connect my Mac to the TV scree. I wish to do a slide show on the TV. However, on the Mac, using ITunes to share photos with the TV, I cannot locate all photo files. What is the best way to save the slide show a

    I have lightroom 5.7. Now I have apple TV to connect my Mac to the TV scree. I wish to do a slide show on the TV. However, on the Mac, using ITunes to share photos with the TV, I cannot locate all photo files. What is the best way to save the slide show and put it where the Mac sharing can find it? So far, I made on one folder in Lightroom, put some photos there and I found them easily. Can this be done with a slide show? Please help quickly! Also worried that the photos I put on the new folder are hard to find afterwards, when the show is done. Where do they go when I delete from from the new folder?I am not alone

    Not that I'm aware of. You just export JPEG copies to a folder that you can point iTunes to. For instance, I have created a folder in my Pictures folder called Apple TV. And within that folder I have other folders of pictures that I can choose from in iTunes to share with Apple TV. But there doesn't seem to be any way to share a Lightroom slideshow. If you have laid to create a video file that would probably work. Apple TV is a little clunky in my opinion. Some things are a little more difficult to do now than they were a while back. I probably haven't provided you with much help, but just keep experimenting and I think you will figure it out.

  • What's the best way to save an 8.5 x 11 image for use as a page background in a PDF?

    What's the best way to save an 8.5 x 11 image for use as a page background in a PDF? My goal is to have a relatively small final .pdf file size that includes numerous pages with full 8.5 x 11 images as backgrounds in the document. If I save at 8.5 x 11 and 72dpi (example), the image is not 8.5 x 11, and the quality is not good enough. I need help with size, dpi, and file format to save as before I place it in InDesign and then save as a .pdf.
    Thanks,
    Jim

    Do exactly what I said then.  Create the InDesign document of the required dimension, and chose whether it will be high quality print, or Interactive PDF.  It really doesn't mater what format you bring the image into that document.  It can be JPG, PNG, but I usually use native Photoshop PSD.  The image does have to be of high enough resolution, but it can be many times bigger than iis required for the final export.  (InDesign does not import the image, but rather references it on your hard drive.)
    When you have placed your text and finished your page, then export it to PDF, but go through the tabs chosing suitable settings.  If the image needs to be downsized, InDesign will do that at this stage while building the PDF.
    If you can tell us how this presentation will be made (Projector, overhead projector, printed page etc. or just emailed to the end users) we can help you more with the final output settings. 

  • What's the best strategy to implement ads?

    Hello Everyone,
    I’ve inherited a site as the content manager and the
    owners would like to start selling ad space on certain pages.
    Mostly the ad banners will be on the either side of the web pages.
    To see the site with out signing-up this page is public:
    http://www.kidstylesource.com/industry/index.php?option=com_content&task=blogcategory&id=2 7&Itemid=91
    The site is built with Joomla and Dreamweaver. The site is
    fairly removed from the Joomla structure that Dreamweaver will be
    playing a big part here setting up ad banner areas. Joomla has
    it’s own way of running ad banners but as mentioned
    it’s very removed from the Joomla way.
    I’m just wondering what is the best strategy to
    implement the ads with placement on the page, tables and/or div
    with out doing a whole rewrite of each page? The body of the pages
    are a mix of tables and div.
    Also I’d like to think about the future using an ad
    server as I’ve never used one before and don’t know
    what code/structure the ad server is expecting on the website. At
    this time the website is just getting off the ground so I feel an
    ad server is not necessary until traffic picks-up.
    Many Thanks,
    John V.

    Hi Helen,
    Are Form1, Form2 etc five different pages? Are they based on different tables?
    Typically, a tree would be a heirarchical structure (child, parent, grandparent etc) - your structure is more like a simple list.
    Also typically, a report is used as the front-end to a form. A link on the report would move the user to a form that allows them to insert/update/delete data. If the five "forms" are based on different data, I would have five tabs in your app - one for each - and have the front-end report as the main page for each tab.
    Or, perhaps, I'm reading your requirement wrong?
    Andy

  • What's the best way to save battery life on ios 7

    What's the best way to save battery life on ios 7

    Turn off services that you are using, e.g., bluetooth, cellular data, etc.
    See also here:
    https://www.apple.com/batteries/ipad.html
    http://ipod.about.com/od/ipad/a/conserve-ipad-battery-life.htm
    http://www.ibtimes.com/apple-ios-7-release-15-ways-improve-battery-life-your-iph one-or-ipad-1413218

  • What is the best strategy to use both Z10 and Q10?

    Assume I have both a Z10 and Q10 and I'd like to use it on alternate days, what's the best strategy to do so?
    BBM should be fine with the same BlackBerry ID and it can just keep switching between the 2 devices.
    If I am using local contacts and calendars, is there an easy switch to keep them sync on both Z10 and Q10?
    There are also other information to sync in Password Keeper, Remember...etc.
    Is there a solution?

    Hello,
    For calendar and contacts, there is this:
    http://supportforums.blackberry.com/t5/BlackBerry-Q10/How-To-OTA-Sync-BB10-and-non-BES-Outlook-Overv...
    With that, I actually keep all of the following in sync:
    Two instances of Desktop Outlook (2007 and 2010)
    Z10
    PlayBook
    Outlook.com
    And, before I decommissioned it, also an Android device. Any device that can synchronize with Outlook.com can use this solution to keep in sync for calendar and contacts. You, of course, need to not use solely local contacts and calendar but instead keep them synchronizing with Outlook.com.
    For the other things you mention, I know of no solutions other than backup/restore...but I do not recall if LINK offers the selective method for those.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Need help editing for 14:9 broadcast -- what's the best strategy?

    Hi,
    I work for a station which broadcasts in 14:9. I can cope easily with this when using full screen images by visualising, roughly, what will be lost on the left and right. But now I want to use split-screens and image collages using smaller, scaled down pictures, and want to be able to design the material precisely within a 14:9 frame so that none of the material is lost.
    What's the best strategy for this? Is there a cartesian co-ordinate I shouldn't stray beyond -- or better, is there an easy way with a mask, perhaps, to show 14:9 within a 16:9 timeline. (I'll be editing with a 16:9 timeline). Can I somehow create two vertical lines to visually provide the limits of the 14 component of the aspect?
    Many thanks for any help.
    macbook pro   Mac OS X (10.4.7)  

    Well, you could certainly create a mask in PhotoShop that is 720x480 wide, but has a 630x480 hole in it. Then bring it in and set its anamorphic flag and put it on the top Video layer to see a 14:9 window.
    I arrived at 630 by multiplying 720x14 and dividing the result by 16...
    Patrick

  • What's the best way to removed unwanted files?

    I have an iMac G4 running OS X 10.4.11 with 1GB of DDR SDRAM. I'm wondering what's the best way to remove unwanted files from the RAM, if it's even possible. There are apps and other files I no longer need. If I can dump the unused files will it help the computer run a little faster? Can I eliminate the unwanted files some how by myself or do I need a program that does it? Thanks

    bad dad wrote:
    I have an iMac G4 running OS X 10.4.11 with 1GB of DDR SDRAM. I'm wondering what's the best way to remove unwanted files from the RAM, if it's even possible. There are apps and other files I no longer need. If I can dump the unused files will it help the computer run a little faster? Can I eliminate the unwanted files some how by myself or do I need a program that does it? Thanks
    Applications are stored perminately on the harddrive [ Macintosh HD ]. When applications are running that is when they appear in a window, they take up RAM. You see your running applications by using activity monitor:
    Macintosh-HD -> Applications -> Utilities -> Activity Monitor
    Application when they are not running, they do not take up RAM.  You will not see any performance improvement when you delete an application from your Harddrive.  [ unless you have filled up your harddrive ]
    Best to have greater than 2gig of free space on your Harddrive.  Many posters to these forums state that you need much more free space: 5 gig to 10 gig or 10 percent of you hd size.
    Most applications do not take up much space on the Harddrive.  I copy my unused application to a folder named additional applications.
    (0)
    Be careful when deleting files. A lot of people have trashed their system when deleting things. Place things in trash. Reboot & run your applications. Empty trash.
    Go after large files that you have created & know what they are.  Do not delete small files that are in a folder you do not know what the folder is for. Anything that is less than a megabyte is a small file these days.
    (1)
    Run
    OmniDiskSweeper
    "The simple, fast way to save disk space"
    OmniDiskSweeper is now free!
    http://www.omnigroup.com/applications/omnidisksweeper/download/
    This will give you a list of files and folders sorted by size. Go after things you know that are big.
    (2)
    This will save you a gig of space.
    Monolingual is a program for removing unnecessary language resources from Mac OS X,in order to reclaim several hundred megabytes of disk space. It requires at least Mac OS X 10.3.9 (Panther) and also works on Mac OS X 10.4 (Tiger). It worked for me on 10.4
    http://monolingual.sourceforge.net/
    A detailed write-up on how to use Monolingual:
    http://www.jklstudios.com/misc/monolingual.html
    (3)
    These pages have some hints on freeing up space:
    http://thexlab.com/faqs/freeingspace.html
    http://www.macmaps.com/diskfull.html
    (4)
    Buy an external firewire harddrive.
    (5)
    Buy a flash card.

  • What is the best way to safeguard my files and pictures before I send off my MacBook Pro to get fixed?

    What is the best way to safeguard my files and pictures before I send off my MacBook Pro to get fixed? I am running Mavericks and use an AirPort Time Machine to back-up all my files.

    Back up all data on the internal drive(s) before you hand over your computer to anyone. You need at least two independent backups to be completely safe. There are ways to back up a computer that isn't fully functional—ask if you need guidance.
    If privacy is a concern, erase the data partition(s) with the option to write zeros* (do this only if you know how to restore to an empty drive.) Don’t erase the recovery partition, if present.
    Keeping your confidential data secure during hardware repair
    Apple also recommends that you deauthorize a device in the iTunes Store before having it serviced.
    *An SSD doesn't need to be zeroed.

  • What is the best way to merge a file content into log file

    What is the best way to merge a file content into log file.
    In worst case, I will read the file line by line as string, then use
    logger.info(lineString)to output to log file.
    However, is there better way to do this?
    The eventual log file will be something like:
    log message 1
    log message 2
    content from file line 1
    content from file line 2
    content from file line 3
    log message 3
    log message 4Thanks

    John618 wrote:
    Thank you and let me explain:
    1. What do you mean by better?
    I would like to see better performance. read line by line and log each line as string can be slow. Did you measure this and determine that it is actually a problem for your application? Or are you guessing?
    Regardless of what you do you are still going to need to read the file.
    >
    2.The only better way I can think of is not having to do it, but I assume you have a very good reason to want to do this.
    Yes, I have to do it beacuse the requirement is to have that file content be part of logging.
    Any idea?How is it supposed to be part of it? For example which of the following is better?
            File AAA - contents
                       First Line
                       Second Line XXX
            Log 1
                    2009-03-27 DEBUG: Random preceding line
                    2009-03-27 DEBUG: First Line
                    2009-03-27 DEBUG: Second Line XXX
                    2009-03-27 DEBUG: Random following line
            Log 2
                    2009-03-27 DEBUG: Random preceding line
                    2009-03-27 DEBUG: ----- File: AAA -------------
                    First Line
                    Second Line XXX
                    2009-03-27 DEBUG: Random following lineBoth of the above have some advantages and disadvantages.
    The first in a mult-threaded app can end up with intermittent log entries in between lines, so having log lines with thread ids becomes important.
    The first can be created by reading one line at a time and posting one at a time.
    The second can be created by reading the entire file as a single string and then posting using a single log statement.

  • What is the best way to find a file on the servers disk without using web.xml?

              What is the best way to find a file on the servers disk without using web.xml?
              I want to find a configuration file not contained within the war file I have
              created. Is there a way to pass information into the ServletContext with out
              rebuilding the ear or war files? Tomcat 4.0 can do this in its server configuration
              files. Does BEA have the equivalent?
              Regards,
              Eric
              

    You can specify the path to the file as a system property
              eg
              java -Dconfig.file.location=./mydirecotry/myfile.txt com.test.MyApp
              "Eric White" <[email protected]> wrote in message
              news:[email protected]..
              >
              > What is the best way to find a file on the servers disk without using
              web.xml?
              > I want to find a configuration file not contained within the war file I
              have
              > created. Is there a way to pass information into the ServletContext with
              out
              > rebuilding the ear or war files? Tomcat 4.0 can do this in its server
              configuration
              > files. Does BEA have the equivalent?
              >
              > Regards,
              > Eric
              

  • What is the best way to name a file?

    What is the best way to name a file? Use "_" so that the characters make one, long name? Why do that?

    Another take on naming files, particularly image files, is like this:
    I use a file remaning application like Name Mangler to back, sequentially rename the photos.  I put them in a folder with a similar name.  Using the format I do, YYYY-MM-DD- Description-001.jpg, they are easy to sort by date by sorting alphanumerically.
    OT

  • What is the best way to keep your files organised

    I would like to know what is the best way to keep your file organise when I am
    Loading program's like numbers and pages from iPhone to MacBook i alway 
    Get double of the same work sheet

    I would like to know what is the best way to keep your file organise when I am
    Loading program's like numbers and pages from iPhone to MacBook i alway 
    Get double of the same work sheet

Maybe you are looking for