Java.IO File permissions on windows

Hey Guys,
I have a single box running Windows and Oracle 10gR2. I need to read a file from the file system on the same box. Except I'm getting the following error
general excecption:the Permission (java.io.FilePermission D:\XX_FOLDER\file.pdf read) has not been granted to ATSYS. The PL/SQL
to grant this is dbms_java.grant_permission( 'ATSYS', 'SYS:java.io.FilePermission', 'D:\XX_FOLDER\file.pdf', 'read' ) After trying what is suggested, I still get the same error, Does anyone have ideas why?
Thanks in advance
Kris

Kris,
please be sure to verify all your steps by reading the chapter Security for Oracle Database Java Applications in the Java Developer's Guide of the DB documentation (http://download-uk.oracle.com/docs/cd/B19306_01/java.102/b14187/chnine.htm#BABFBDGG)
It also worth to note that all user names must be written in UPPER CASE since there is a difference between lower and UPPER case in Java.
--olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • How to edit NTFS file permissions in Windows PE 3.0

    Does anyone know how to edit NTFS file permissions from Windows PE 3.0?

    Hello,
    The Windows Desktop Perfmon and Diagnostic tools forum is to discuss performance monitor (perfmon), resource monitor (resmon), and task manager, focusing on HOW-TO, Errors/Problems, and usage scenarios.
    Since your post is off-topic, I am moving it to the
    off topic forum.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Problem with file permissions in Windows shares

    Due to a company merger we are now supporting a group of Macs in our PC environment. These Macs connect to our Windows shares. This generally works well, however we have discovered a problem. It’s to do with the way our Macs interact with our Windows shares. When they copy a file to a windows share they take the permissions for the file they copy from the route of the share rather than from the subfolder the files are copied to and write the file permissions accordingly.
    This only affects admin users who use Macs with the ability to change file permissions. Everyone else inherits the permissions from the subfolder as they should because their account can’t change the permissions. If the route and subfolder permissions are the same then there is no change. If they are different, the Mac will use the share route permissions as preference.
    We have shares where users don’t have access to the route folder but do have access to other folders. This is so that they can’t change the top level folder structure. However they are able to create folders and files under the top level folders. If an administrator uses a Mac, no one has access to any files or folders they create because users don’t have access to the route folder and this is copied to the files and folders they create. This doesn’t affect our PC’s only the Macs.
    We are using the latest Mac OS fully updated and Windows 2008 server. Is this a normal Mac ‘Feature’? Is there a work around?

    I’m a bit disappointed by the lack of response to my problem. As Windows is the predominant file server in business, this problem must have occurred before.
    Are Mac people really saying that Macs are not designed to connect to networks? At the moment our Macs are unusable apart from a few isolated tasks. Basically they are used by a few designers who work in isolation. If PC’s had this problem no one would buy them.

  • Problem Assigning file permissions on windows client

    I have created some Users and Groups in the OD. I have several Windows PC's including Server 2003 installations. SMB is running and configured as "primary domain controller".
    When I browse the OD from the Windows client to assign file permissions I ONLY see the USERS, not the Groups. I have Groups and Users checked in the "Locations" sub dialog.
    ie. Right Click on folder to share, choose Sharing and Security, choose Permissions, choose Add, choose Advanced, choose Find. Same thing in the Security Tab. Same thing in the User manager.
    This also affects the logons. I don't want to have to add each user every time I want to share or give logon permissions on the Windows client. Adding a Group is much easier.
    Any suggestions?

    N'<national symbols>', being part of an SQL statement, will be converted to the database character set (WE8ISO8859P1) before being parsed. Only if the client and the database are both 10.2 or higher, the client can encode the literal appropriately so that it survives this conversion.
    In earlier versions, you can do the encoding yourself. Instead of the N'<national symbols>' literal use the UNISTR function: UNISTR('\xxxx\yyyy\zzzz'), where U+xxxx, U+yyyy, U+zzzz are Unicode code points of your national characters.
    -- Sergiusz

  • File Permissions in windows XP

    ok im alittle stumped on this
    i need to give my application read\write access to %USERPROFILE%\\savedir
    now if i put it fully qualified
    i.e.
    permission java.io.FilePermission "C:\\Documents andSettings\\zaelld\\.saveDir", "read, write";
    it works fine
    by
    permission java.io.FilePermission "%USERPROFILE%\\.saveDir", "read, write";
    that should work as ide assume $HOME/.saveDir in linux would work fine(i havent tested that yet)
    and i ONLY want the program to have access to .saveDir
    any ideas? or have a missed something obvious:?

    well then i should have read the file permissions tutorial more carefully
    permission java.io.FilePermission "${user.home}\\.saveDir", "read, write";
    fixed

  • Fix downloaded files permissions on Windows 7

    Almost every time I download a file from various sources, Firefox adds a padlock to the downloaded file icon. This means that the file can only be accessed by the current user unless I change back the file permissions manually.
    Is there any way of stop the downloads from changing their file permissions? I've only noticed this happening for a week or so, currently I'm on Firefox beta 26.0

    You can try to set the browser.download.manager.scanWhenDone pref to false on the <b>about:config</b> page to prevent Firefox from adding zone identifier data to the downloaded files.
    See:
    *http://kb.mozillazine.org/Unable_to_save_or_download_files

  • Descriptions of java dll files for windows

    I'm new to java programming and would greatly appreciate of someone could guide to documentation on java dll files for SDK windows..
    thanks

    If you are new, you don't want to know about the DLLs since there are not much you really need to know except you are writing JNI methods. Even you are writing JNI methods, you don't really need to care about the DLLs. Also I did not notice that there is any documentation about the DLLs/SOs. If you really want it, you may want to get this book: The JavaTM Native Interface by Sheng Liang
    If you want toe documentations about JDK:
    http://java.sun.com/j2se/1.3/docs/index.html
    or
    http://java.sun.com/j2se/1.4/docs/index.html

  • Java.io.File and uppercase/lowercase

    Hello,
    I am running into a weird problem with java.io.File on a Windows system. My program needs to validate a path the user entered. Sometimes, the path will contain a directory name that should be uppercase, but which the user entered in lowercase instead, and the <File>.exists() returns true anyways. I know on Windows, on the command line, directory and file names are not case-sensitive, which is probably why it was done that way. But this is causing problems because once the path is (supposedly) validated, it is handed to a Unix program (case-sensitive), and if it's not really valid there, the user has no way of correcting it. Whereas if it were found as invalid in the Java program, I could pop up an error, and the user could correct it.
    The bottom line is, is there a way of telling a File object to return false if the path name is not EXACTLY identical, on Windows? Or would I have to check the path myself, without relying on File?
    Thanks in advance,
    J-S

    In this case, this is not acceptable, since the files or directories on disk can be in any case. I just need the entered case to be exactly the same as the files.
    In other terms, I need File.exists() to return false if the case does not match. I would think there is a way to do this, since internally, the function checks if the operating system is Windows or Unix before doing the comparison, and acts differently in each case...
    From http://java.sun.com/j2se/1.3/docs/api/java/io/File.html (see equals or compareTo method) :
    "On UNIX systems, alphabetic case is significant in comparing pathnames; on Win32 systems it is not."
    I would like to force the Unix way of doing.

  • Installed Photoshop cc 2014 asks for serial # - corrupted Windows file permissions

    More of a warning / heads up to all than a question - installing Photoshop cc 2014 [via the CC manager app] caused some Windows file (security) permissions to become corrupt corrupt on my system. Symptoms include cc2014 asking for serial number validation on startup (when, as a cloud version, it should not do so), then being unable to connect to the internet when you press the 'validate serial' button so getting that window into infinite loops, and - a real pain in the *** when trying to fix the above - causing abends of some windows shell functions that in turn cause windows explorer to crash and restart.
    Anyhow, digging into this (fortunately, I am a long time Windows SysProg) I discovered that for reasons unknown, either the CC master app or the actual Photoshop cc2014 installer (or both) are changing file access control permissions on a number of files, mostly DLL's. Most of the files affected are in the (normally hidden) Program Data directory on the windows root disk, Some of them are in the Adobe subdirectory - so fair enough if they want to fool around with their own program - but others being changed are in the Common Files and Microsoft subdirectories. I cannot for the life of me figure out why this is necessary nor why Adobe feel the need to touch files that 'do not belong' to them - something dangerous in the extreme as an external app such as Windows Update might replace or 'repair' the files so touched, and if Adobe / CC are relying on file permissions on non-Adobe files, such changes could result in all manner of random and spurious problems / error messages occurring.
    Anyhow, if, fellow Photoshop cc 2014 user, you get this happen to you then you can fix the file permissions by opening a console window [also called a "DOS box", or "command prompt" depending on your age and knowledge... 8-) ] and run the windows file checker with the command
    "sfc /scannow". Make sure that you use 'run as administrator' to open the console window, or you'll get an error about sfc only being available to administrators. Also a very (very) sensible idea to close all non-essential running applications first to prevent any possibility of weird interactions happening.
    Finally, check that the 'hosts' file in [root drive]:/Windows/System32/drivers/etc is valid - for some reason, it looks like the install tried to check or update this file (again, I have no idea why) but the result was a corrupted hosts file, which I assume is the root cause of the 'unable to connect to host' type internet error messages. Copy the file, rename it as 'hosts.txt' and edit it with notepad or wordpad. Look for lines containing garbage strings at the bottom of the file  (any line that starts with a # ignore, it is a comment, and any line that has IP addresses or host names should be ignored - though if they reference a site such as "someserver.adobe.com" you might want to treat them with suspicion if you continue to get internet 'cant connect to site' type errors.
    Anyhow, when I fixed these two sets of problems, Photoshop cc 2014 started 'right first time' without all the BS messages about serial numbers etc.
    Hope this helps somebody out there in AdobeLand......
    Rick

    Update: I tried several times to reproduce the error, actually it dosen't occur. I changed nothing on my system, without reboot it twice. This is what I said in my beginning times: it occurs sometimes but often. I will keep you up to date.

  • Windows file permissions problems

    We have an Xserve G5 that was running Server 10.3. I upgraded it directly to Server 10.5. Since then, I am having problems with some of our Windows users.
    When they create a new folder, it puts them as the owner, but gives them NO rights. I am using ACLs to give full rights to the group that needs access, and also setting the POSIX group rights to read/write. So once they leave that folder, they can no longer get back in. I have SMB set to inherit rights from the parent, and the ACL is set to inherit as well. Other people in the group can access the folder, just not the owner! I change the owner permissions and all is well (for that folder at least). How do I need to set SMB so it follows the inheritance I set?
    Once I have the folder set correctly, any new files created there have the POSIX group set to read only. The ACL inherits properly and still has full control. The owner is set correctly, usually. It is not consistent.
    Once someone creates a file in any folder, if a Windows user modifies a file someone else created, it changes the owner name and gives them no rights. It also creates a new ACL record. If the original owner was a Mac user, it creates a new explicit ACL with all rights except execute and delete. If the file has ACL records already, it duplicates them and gives whatever rights it feels like (it seems). One new record may say Allow Delete only, and the next one say Allow Read except for execute. The only thing for certain is it will never match the original ACL. It always adds the new ACLs at the top of the list, and the duplicates are grayed out as if they were actually inherited that way. The most 'popular' file I've found so far had 128 "inherited" ACL records!
    It is also denying access to some folders that the user has the correct permissions for. For instance, I can create/modify/delete files logged in on the Mac side, but when I log in on Windows, I have problems accessing files/folders. It shows everything as read only. Even if I change the properties in Windows, it will revert back to read-only when I apply the change.
    We have a new Xserve that we will be moving the file services to. At that time, all the Windows users will be moved completely to the Mac side - currently the Windows users are accessing the Xserve and a Novell server.
    Thanks in advance for any help.

    Hi Thy,
    Based on my research, the Trusted Installer is a service, for those resources which only allow Trusted Installer to modify, neither Administrator nor System can modify them.
    I am wondering that how secure the network and physical environment is that you need to create a GPO to prevent users making permissions changes on system files. These system files normally only can be modified by Administrators,
    System or Trusted Installer, which is secure enough when we don’t add users we don’t trust enough to Administrators group.
    >What is the best way to undo this while leaving the audit failures turned on and still retaining the correct permissions on all the files?
    As long as administrators on these machines are qualified, you can remove the Group Policy. If not, please don’t make any user you don’t trust as Administrator.
    >What happens to the files that aren't owned trustedinstalled than now have the trustedinstaller default permissions under system32 and syswow64 if I were to remove the gpo?  What file  permissions would be retained?
    We should keep the default permissions, if those files weren’t owned by Trusted Installer before, we should change the original owner back, vice versa.
    Here are some related articles below I suggest you refer to:
    New ACLs Improve Security in Windows Vista
    http://technet.microsoft.com/en-us/magazine/2007.06.acl.aspx
    SYSK 277: How-To Bring Back the TrustedInstaller
     http://blogs.msdn.com/b/irenak/archive/2007/01/30/sysk-277-how-to-bring-back-the-trustedinstaller.aspx
    Best Regards,
    Amy

  • Modify file permissions in a windows environment

    Hi everyone,
    I'm currently looking for a way to define a file as readable and writable under a Windows environment.
    I saw 3 relevant methods in the java.io.File class, which are:
    setReadable
    setWritable
    setExecutable
    There are 2 versions of those methods, among which you have one that allow you t set readable and writable flags for "everyone" (meaning any user?).
    I am currently develloping an application where files must be shared (readable and writable) between many users (from a Windows user point of view).
    Reading the files causes no issue. However, a "FileNotFoundException (access denied)" is raised anytime I try to overwrite a file created by some other windows user.
    Apparently, those setWritable, setReadable methods do not work ... or I am messing up somewhere?
    The solution I'm looking for has to be Java native, since this application has to remain portable to any other platform (no Runtime.exec call with DOS commands).
    Here's a dummy application I made which can help you reproduce my problem:
    package local.test;
    import java.io.File;
    import java.io.FileWriter;
    import java.io.IOException;
    public class Test {
         public static void main(String[] args) throws IOException{
              File file = new File("C:/test.txt");
              file.createNewFile();     
              System.out.println("R - " + file.setReadable(true));
              System.out.println("W - " + file.setWritable(true));
              System.out.println("X - " + file.setExecutable(true));
              System.out.println("R everyone - " + file.setReadable(true, false));
              System.out.println("W everyone - " + file.setWritable(true, false));
              System.out.println("X everyone - " + file.setExecutable(true, false));
              FileWriter writer = new FileWriter(file);
              writer.write(System.getProperty("user.name"));
              writer.close();
              System.out.println("R - " + file.setReadable(true));
              System.out.println("W - " + file.setWritable(true));
              System.out.println("X - " + file.setExecutable(true));
              System.out.println("R everyone - " + file.setReadable(true, false));
              System.out.println("W everyone - " + file.setWritable(true, false));
              System.out.println("X everyone - " + file.setExecutable(true, false));
    }All functions return true with the first user. When executing with some other user, setWritable always return false.
    The call to writer.write(System.getProperty("user.name")); raises an exception when trying to open the FileOutputStream.
    Just for the memo, the files I want to create will be under the "Documents and Settings\All Users\Application Data" folder.
    Thanks in advance for your help,
    Eric

    Alan,
    Many thanks for your reply, it really helps knowing that I shouldn't look any further yet.
    I believe it may be useful to add this note to the javadoc, because it currently mentions that the call to this method will set it as readable/writable/executable for "everyone", with no more information, which is why I was a bit lost.
    Anyway, I'm looking forward to the JDK7 ;) Keep up the good work!

  • Windows 7 ignores file permissions for shared 10.5.8 folder

    I set up a shared folder on my Mac using SMB. I also set up an account with limited privileges (read only) for accessing it. The problem is that, while the Windows 7 computer needs the account password to access the folder, once it's accessed the file permissions are completely ignored, permitting to user to change and delete files at will.
    Any ideas on how to keep the folder Read-Only?

    When you enter the account's password, you are logging in to the Mac as that user, which is why everything is coming up as read + write.
    This article indicates that you have to provide the account name and password for SMB sharing:
    http://docs.info.apple.com/article.html?path=Mac/10.5/en/8201.html
    There's a special forum for Windows compatibility; you might want to search and/or post in there:
    http://discussions.apple.com/forum.jspa?forumID=687

  • Can New Java 7 File API Path Objs Be Used For Windows Virtual Folders

    Hello,
    I'm trying to duplicate a JFileChooser's drop-down list containing root directories of the file system. For Windows machines, its combobox lists the roots in a nice tree-like layout. For example:
    + Desktop
      + Computer
        + Local Disk (C:)
        + Data (D:)I cannot find an offical way to do this; I ended up using a class called "ShellFolder" to do it. Based on the "File" objects returned by the "ShellFolder" operation, I wanted to use the "toPath" method of the "java.io.File" object to convert the object to a "java.io.file.Path" object. Unfortunately, when I try to convert it, a java.nio.file.InvalidPathException" occurs.
    Therefore, is there a way to use the the new Path object (provided by Java7's new File NIO APIs) that can map to Windows special virtual folders (like "My Computer" which is mapped to a CLSID like "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")?
    Note: It looks like NetBeans suffered from the same problem. See their bug report here: [https://netbeans.org/bugzilla/show_bug.cgi?id=214011] .
    Here's some sample code to reproduce the problem:
    static public void main(final String[] asArguments)
         javax.swing.SwingUtilities.invokeLater(new Runnable() {
              @Override
              public void run()
                   java.io.File homeFile = FileSystemView.getFileSystemView().getHomeDirectory();
                   System.out.printf("File obj for home dir = %s\r\n", homeFile.getAbsolutePath());
                   java.nio.file.Path homePath = homeFile.toPath();
                   System.out.printf("Path obj for home dir = %s\r\n", homePath.toString());
                   // get the root directories
                   java.io.File[] rootDirs = (java.io.File[]) sun.awt.shell.ShellFolder.get("fileChooserComboBoxFolders");
                   for (int nIdx = 0; nIdx < rootDirs.length; nIdx++) {
                        java.io.File nextRoot = rootDirs[nIdx];
                        System.out.printf("File obj for next root dir = %s\r\n", nextRoot.getAbsolutePath());
                        // Is this a bug?
                        //          When we encounter a special Windows folder,
                        //          like "My Computer" which has a filename of "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
                        //          why do we receive a "java.nio.file.InvalidPathException"?  Should it not resolve the path
                        //          to the virtual Windows folder of "My Computer", just like the java.io.File objects do?
                        //          If not, is there an alternative way to get that information using the new Java 7 File APIs?
                        java.nio.file.Path nextRootPath = nextRoot.toPath();
                        System.out.printf("Path obj for next root dir = %s\r\n", nextRootPath.toString());
                   } // for
              } // run
    } // mainEdited by: RhinoGuy on Aug 10, 2012 11:11 AM

    Hmm don't know about special folders but the File object does have a listRoots() method. Perhaps that only returns mapped drives on Windows though, I remember using it to create my own Eclipse type filechooser which I find a lot more user-friendly than the standard JFileChooser.

  • How to make a java-program to a exe file runing on windows?

    i kown that there were many topics on this problem.
    i want to kown how many kinds method to do this i can use now!
    i met a java-program can run on windows,but i don't find ant *.class
    files and *.jar files.it's extended file type is ".ese".
    thanks very much

    There are commercial products that allow you to do this (e.g. InstallAnywhere from http://www.zerog.com).
    One issue is that you have to decide whether you want to bundle a JRE with your program or not. If you do (and you should, in these days of XP shipping without any VM of its own), your program will be a minimum of about 9MB + whatever you actually add as part of your program :-).
    In any case, this is not a trivial undertaking.

  • Java File Permissions

    I'm relatively new to Java. I'm creating a program that will be running on 40 terminals, and will simulate a wireless mobile network. Our teacher has instructed that we should simply use a text file to keep track of where all the nodes are in the network, and when a node moves, it simply updates that text file. I'm looking to have some sort of system where the process checks to see if the text file has write permission, and if so, it will turn the permission to read-only, update the file, then set it back to write so nodes will be able to access the file and update locations while another node is updating, but another node will not be able to write to it until the node holding it has finished.
    I have looked in Class File, and I see checkWrite(), setReadOnly(), and checkRead(), but I'm not sure how to change the file permissions back to write.
    Am I going about this in the right way? If so, how do I change a file back to write access?
    Thanks, and if any more ingo is needed, let me know.

    java fully supports writable files. Look at class java.io.FilePermission. Your default java policy file may not allow you to write to files, but that can be edited manually or via the policytool . This forum should have several posts about how to modify the policy file so that you can write files. Once you edit that file, you will have read/write access, when appropriate.

Maybe you are looking for