Can I make a file uneditable??

Hi there!!
In fact my java app creates a config file on the client's machine and I want that after the file's creation the client or any user can't edit the file,,,is it possible some way??
Thanks...

use the
setReadOnly()
method on the File class. (since java 1.2)
It doesn't stop people from modifying the file but makes it likely that thy won't accidentaly modify it. They have to deliberately change the file permissions. (Note this is platform dependent. On some OS's it may have no effect whatsoever)
matfud

Similar Messages

  • Error "Can't make every file of ... into type alias list" - please help!

    Hi
    I am trying to adapt a script that uses Max (an audio conversion tool) to convert files in a folder to another format. The original script which I found on a forum asked the user to choose the folder with the files in which need to be converted, but I want to specify the folder in the script so that it can be automated. So I changed the line:
    set sourceFolder to choose folder
    to
    set sourceFolder to "Macintosh HD:Users:nick:Desktop:test:"
    However I then get the error (this is the only line in the script I changed and the original script works fine):
    error "Can’t make every file of "Macintosh HD:Users:nick:Desktop:test:" whose name extension = "m4a" into type alias list." number -1700 from every file of "Macintosh HD:Users:nick:Desktop:test:" whose name extension = "m4a" to «class alst»
    Could someone let me know why I am getting this error and how I can sort it. The full script is below.
    Thanks
    Nick
    tell application "Max" to activate
    tell application "Finder"
    set sourceFolder to "Macintosh HD:Users:nick:Desktop:test:"
    set theFiles to (every file of sourceFolder) as alias list
    repeat with aFile in theFiles
    tell application "Max"
    convert aFile
    end tell
    delay 1
    tell application "System Events"
    tell process "Max"
    click button "Convert" of tool bar of window "File Conversion"
    set encoderOpen to true
    repeat while encoderOpen is true
    try
    window "Encoder"
    on error
    set encoderOpen to false
    end try
    end repeat
    end tell
    end tell
    end repeat
    end tell

    nick_harambee wrote:
    set sourceFolder to "Macintosh HD:Users:nick:Desktop:test:"
    This saves a string (Macin...) under the variable sourceFolder. You then try and use sourceFolder as an alias which doesn't work. To fix the situation try saving sourceFolder as an actual alias in itself. For example...
    set sourceFolder to folder "Macintosh HD:Users:nick:Desktop:test:"
    or perhaps
    set sourceFolder to "Macintosh HD:Users:nick:Desktop:test:" as alias
    Either of those should correct your problem.
    When using "(choose folder)" you get an alias returned which is why the original script worked fine.

  • How can i make a file a .jar again?

    Ive opened a minecraft.jar with Archive Utillity so i can change pictures but ow can i make a file a .jar again?

    You have not said what your target size is nor how many photos you have or how large on screen. Nor what version of Pages you are using. Nor whether it is just for looking at on screen or you require a good print.
    Reducing file size is a combination of things that can be done with no loss of quality:
    1. Crop and reduce resolution of images in a 3rd party application, Preview will do.
    and those that will reduce quality
    2. Menu > File > Reduce File Size
    3. Menu > Share > Export > PDF > Good (Good is not very good unfortunately)
    Use vector (drawing) pdfs in place of bitmap (photo) images can save considerable size. Preparing photos in other programs also allows you to control the image quality of jpegs and tricks like slightly blurring them prior to saving.
    Pages is not very efficient in this regard and there are limits to what you can do. Lots of images, covering a lot of the page does add up to a bigger file whatever you do.
    Peter

  • Applescript "Finder got an error: Can't make document file"

    I can get the file contents if I use choose file but if I do it this way, I get the error:
    error "Finder got an error: Can’t make document file ... to file
    Code:
    tell application "Finder"
              set theFolder to (choose folder with prompt "Select the start folder")
              set file_list to every file of theFolder
              repeat with myfile in file_list
          log (name of myfile as string)
          set fileContents to read myfile
          set fileText to paragraphs of (fileContents)
          repeat with nextLine in fileText
              if length of nextLine is greater than 0 then
                  log nextLine
              end if
          end repeat
              end repeat
    end tell

    Changing
    set fileContents to read myfile
    to
    set fileContents to read (myfile as alias)
    sorted it!

  • How can i make cotrol file which have conveyor and ?

    how can i make cotrol file which have conveyor " to move the bottle and slider " to fill the same bottle ?
    i attach my control file.............
    " Science is came....not come "
    I study Mechatronics Engineer
    skype : t_alhowaiti
    Attachments:
    convyer.ctl ‏16 KB

    Jeff·Þ·Bohrer wrote:
    billko wrote:
    ThaerAL-Hwaiti wrote:
    i want to make a production line which move a bottle on a conveyor and fill it .
    That's all good and fine, but what have you tried codewise?  Let's see what you have so far and we can go from there.
    The easy answer is "an assignment" and a desire to pass the course without actually needing to read and comprehend information.
    I as trying to be diplomatic about it. 
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • How can i make doc file in ipad

    how can i make doc file in ipad??

    I believe that Pages for the iPad is capable of creating documents compatible with MS Word's .doc format.
    Best of luck.

  • How can I make Keynote files read-only (eg: to share with students)?

    I would like to share some keynote files with students, and I would like to set them up as read-only, so that the students can tap the screen, read my presentation, but not alter it.  I've tried to set the files up as read-only on my iMac desktop, but when I load the file onto my iPad, it's still editable.
    Any ideas re: how to make Keynote files read-only?
    I've tried to export the files as PDF and load them into iBook, but some of Keynote's basic "build" functions won't work this way.  Specifically, I have files set up with questions and answers (ie - a question appears, and you have to tap the screen to see the answer, but this "build" function seems to disappear when I get it to show up in iBook).
    Any ideas how to make Keynote files read-only?  I am happy to use another program, but I want the students to tap the screen in order to see the answer to a question.
    Thanks!

    as long as $PATH is set, you shouldn't need to reconnect them (i think).  if you send the list of apps through | awk -F '/' '{print $NF}' | that'll strip the path
    /edit: added the "(i think)" part
    Last edited by brisbin33 (2009-06-02 21:33:06)

  • Adobe Acrobat 9 can't make pdf files in 2003 Word

    Hello, Can you help me?
    I purchased Adobe Acrobat 9 Pro four years ago when I went onto Windows 7 as I needed the 64 bit version. Prior to this I had Adobe Acrobat 7.
    Recently I have been unable to make PDF files in Word although it is working in all the other Word applications and through the HP scanner.
    It also won’t make PDF files through the Adobe programme and comes up with the message “Missing PDF files”and the repair command fails to save the problem.
    I am using Word 2003 but prior to now the programme has worked without a problem.
    Can you tell me how to solve the problem as I need the facility as I manage numerous websites for different charities.
    My serial number is 1118-1780-5717-0649-5947-1289 and I am reluctant to unload the programme incase I can’t reload it.
    I have tried to load Acrobat 7 onto my laptop which still has Windows Vista on it.  The serial number for this is 1016-1284-2194-6099-0208-1387 but it refuses to activate this.  Can you advise me on this ?
    I am desperate..
    Many thanks, Sheila 

    Pro's Safari Plugin is not updated for Mountain Lion yet.
    Remove the plugin and use Preview for now in Safari.
    Guide on removing Safari plugins: http://macs.about.com/od/usingyourmac/qt/safariplugin.htm

  • Can we make jar file for simple j2se application

    Hi..Can we make a jar file for simple j2se application so that it can be executed on any system like .exe file...

    Read the JAR files section in Sun's Java tutorial.

  • How Can We make video files of images in Flex

    Hi
          Can Any body tell me how can i make a video file of images in flex.Please tell me wether its possible in Flex. to combine images to make a video file.
    Regards
    Vineet osho

    Ok,
    Let me take this example.
    Supposing A vendor with 3 AP open items, B vendor with 2 AP open items.
    When making a payment proposal, SAP shows only 2 lines, namely, collected by vendor code.
    Looking at DME file, however, it shows 5 lines which means all individual open items.
    What we want to make is 2 lines in DME file, which means grouping invoices by vendor in a DME file.
    Hope it makse sense.

  • How can I make a file server sync with a laptop when it connectsSOLVED

    Ok, first let me say that I looked on the Internet for this but didn't find what I was looking for. I'm going to be setting up a simple file server for my in laws soon...they use windows so I'll be using samba on the server side.
    They have 3 computers and want to be able to have all there files stored in one central place so they can share them easily and also have them backed up at the same time. They have 2 desktops and one laptop.
    The desktops are not a big deal to sync with the server because they are on all the time and I can just use a cron job or something. Then problem is the laptop..
    What can I do to make the laptop automatically sync when it gets on the network? 
    The catch is this needs to be ran from the server side so they have a "hands free" experience or whatever. If you know a way for the laptop to do this in the background I guess that would work too.
    I know this is probably a very simple task but so far everything I find the user would have to manually start the sync.
    Thanks in advance for you help!
    Last edited by jonrd (2008-07-27 04:28:57)

    Is it necessary that all the files are on the local hard disks? In the case of the laptop I could understand this if the laptop is also used outside the network, but the desktops should stay in place, no?
    It could be as easy as to make a shortcut on all the computers to the samba-share and tell the inlaws that they have to use the samba-share to store their (shared) files.
    You are correct about this but I doubt they would remember to use this all the time so I want to sync the folders just in case.
    Assuming the laptop is always going to be in the same IP address when it connects to the network (which is unlikely in default configurations), you could create a script that checks for the existence of the machine on the network then perform a sync.  I had a script written in Python somewhere that would check to make sure the server side was up and run unison, but it could be modified to check for the laptop and copy files.  Let me know if that's something you're interested in and I can post it for you.
    This sounds like what I'm looking for. Also I wander If it could be done by NetBIOS  name instead of ip address? This way It wouldn't matter.
    The script sounds like what I'm looking for though
    Thanks for the help!

  • How can I make .PDF files not display inline in an Outgoing mail?

    I want Mail to NOT display PDF files in outgoing messages. It will keep the icon placeholder if it's more than two pages, but not for one page PDFs. How can I stop this? It makes formatting kind of difficult.
    Thanks

    I knew. But I'm hoping for a way to make this the global default since ages...

  • PSE11-Can't Make New Files and Opening Old Files

    I've had PSE11 for a couple of months now and it was working fine about two days ago when i last used it. But today when I opened it up it started to refuse to do anything file related. It won't let me create a new file and it won't let me open any files.
    With the new files I cant even get the dialouge box to pop up to select a size of the file and name. It just runs processes for a couple of seconds and than nothing.
    And with the open files I can't get it to open anything. It won't open pictures, photoshop files, etc. It just sits there like I never gave it a command.
    I all ready checked to make sure the program was up to date. Which it is so I'm not sure what is causing this problem.

    Hey so it magically started working again for a while on its own. I did nothing to it, it just decided to start working randomly. And now its back to not working again. I didn't mess with anything. I didn't even install anything not even a Windows update. It just started working again. And then it stopped just as quickly as it started.
    Though now I can at least get the open command to pop up. But I can't get the actual photos to open or it to do anything beyond that.

  • How can I make .jar files for applications?

    My jar program creates jar files but won't open the program when I double click them. I use the command:
    jar cvf *.jar filenames
    The jar file is created but won't execute. Can anyone tell me what i am doing wrong?
    Thanks
    Jiby

    Hello !
    Well, I had the same problem a week or two ago !
    First, in your *.java, don't use any package...I mean, don't do a package of your program (I guess there is a way to make it work with, but it would need a little bit more work...).
    Then, with the jar tools, use the command
    -jar cf jar_that_you_want_to_create.jar class-that_you_include_in_your_jar.class
    With that, a jar will be created, and when you will try to "run" it, it will say that it can not find the main class...
    You need a Manifest !
    Create a text file MyManifest.text, and write that in your text file :
    Main-Class: classname
    follow the same as i wrote above. leave a blank after colon and a blank line after the first line like above.
    then, well, use tha jar tool again:
    -jar umf MyManifest.txt jar-file-you-created.jar
    To "run" it, double click on it, or use the java tool:
    java -jar jar_you_created.jar
    Thanks to Phani, who helped me with that !!
    Splitsch

  • Can FCP make .gif files?

    The computer with Photoshop is in the shop, so I need to know
    if I can export a movie from Final Cut Pro as a small animated .gif
    file for my website. Thanks.
    Message was edited by: Qbert

    if I can export a movie from Final Cut Pro as a small animated .gif
    file for my website.
    No, but there are lots of .gif maker software titles -have a look on versiontracker or macupdate.

Maybe you are looking for

  • Adobe Flash not working with Windows 8

    I recently updated from Windows 7 to Windows 8. When I open up the app for Internet Explorer in Windows 8, it tells me that I have Adobe Flash Player installed, but if I try to see a video on YouTube, it tells me that I have to install Adobe Flash Pl

  • Oracle ADF UIX and Struts

    Does Oracle ADF UIX use Struts components internally? If yes, Does Oracle Support the issues that arises because this internally used Struts components? (I am using Oracle ADF in my application. Thanks, Aravind.

  • Error in download

    i've tried so many things that the support page says to do when itunes wont download. but i keep getting a pop up that says error writing to file: C:/ProgramFiles/CommonFiles/Apple/MobileDeviceSupport/SyncServices/Schemas/Cale ndars.syncschema/Conten

  • System Copy ECC 6.0

    Hi Experts, We have SAP ECC 6.0 on Windows with MS SQL server. We did a System copy on target system without any errors. Now when try to start the SAP service on Target System, dispatcher is not coming successfully, it is giving the message as "Runni

  • Can't uninstall Quicktime component

    Hi, I'm experiencing problems in trying to install new iTune version. In order to fix that, I would need to uninstall Quicktime. When I try to do that, I can uninstall everything, except for the component "npqtplugin2.dll", because the system tells m