< prev index next >

src/java.desktop/macosx/classes/com/apple/eio/FileManager.java

Print this page
rev 55657 : 8227587: Add internal privileged System.loadLibrary
Reviewed-by: rriggs
   1 /*
   2  * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  38  * executable. A file type of {@code TEXT}  means that the file contains raw text. Any application that can read raw
  39  * text can open a file of type {@code TEXT}. Applications that use proprietary file types might assign their files a proprietary
  40  * file {@code type} code.
  41  * <p>
  42  * To identify the application that can handle a document, the Finder can look at the {@code creator}. For example, if a user
  43  * double-clicks on a document with the {@code ttxt creator}, it opens up in Text Edit, the application registered
  44  * with the {@code ttxt creator} code. Note that the {@code creator}
  45  * code can be set to any application, not necessarily the application that created it. For example, if you
  46  * use an editor to create an HTML document, you might want to assign a browser's {@code creator} code for the file rather than
  47  * the HTML editor's {@code creator} code. Double-clicking on the document then opens the appropriate browser rather than the
  48  *HTML editor.
  49  *<p>
  50  * If you plan to publicly distribute your application, you must register its creator and any proprietary file types with the Apple
  51  * Developer Connection to avoid collisions with codes used by other developers. You can register a codes online at the
  52  * <a target=_blank href=http://developer.apple.com/dev/cftype/>Creator Code Registration</a> site.
  53  *
  54  * @since 1.4
  55  */
  56 public class FileManager {
  57     static {
  58         java.security.AccessController.doPrivileged(
  59             new java.security.PrivilegedAction<Void>() {
  60                 public Void run() {
  61                     System.loadLibrary("osx");
  62                     return null;
  63                 }
  64             });
  65     }
  66 
  67     /**
  68      * The default
  69      * @since Java for Mac OS X 10.5 - 1.5
  70          * @since Java for Mac OS X 10.5 Update 1 - 1.6
  71      */
  72     public static final short kOnAppropriateDisk = -32767;
  73     /**
  74      * Read-only system hierarchy.
  75      * @since Java for Mac OS X 10.5 - 1.5
  76          * @since Java for Mac OS X 10.5 Update 1 - 1.6
  77      */
  78     public static final short kSystemDomain = -32766;
  79     /**
  80      * All users of a single machine have access to these resources.
  81      * @since Java for Mac OS X 10.5 - 1.5
  82          * @since Java for Mac OS X 10.5 Update 1 - 1.6
  83      */
  84     public static final short kLocalDomain = -32765;


   1 /*
   2  * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  38  * executable. A file type of {@code TEXT}  means that the file contains raw text. Any application that can read raw
  39  * text can open a file of type {@code TEXT}. Applications that use proprietary file types might assign their files a proprietary
  40  * file {@code type} code.
  41  * <p>
  42  * To identify the application that can handle a document, the Finder can look at the {@code creator}. For example, if a user
  43  * double-clicks on a document with the {@code ttxt creator}, it opens up in Text Edit, the application registered
  44  * with the {@code ttxt creator} code. Note that the {@code creator}
  45  * code can be set to any application, not necessarily the application that created it. For example, if you
  46  * use an editor to create an HTML document, you might want to assign a browser's {@code creator} code for the file rather than
  47  * the HTML editor's {@code creator} code. Double-clicking on the document then opens the appropriate browser rather than the
  48  *HTML editor.
  49  *<p>
  50  * If you plan to publicly distribute your application, you must register its creator and any proprietary file types with the Apple
  51  * Developer Connection to avoid collisions with codes used by other developers. You can register a codes online at the
  52  * <a target=_blank href=http://developer.apple.com/dev/cftype/>Creator Code Registration</a> site.
  53  *
  54  * @since 1.4
  55  */
  56 public class FileManager {
  57     static {
  58         jdk.internal.access.SharedSecrets.getJavaLangAccess().loadLibrary("osx");






  59     }
  60 
  61     /**
  62      * The default
  63      * @since Java for Mac OS X 10.5 - 1.5
  64          * @since Java for Mac OS X 10.5 Update 1 - 1.6
  65      */
  66     public static final short kOnAppropriateDisk = -32767;
  67     /**
  68      * Read-only system hierarchy.
  69      * @since Java for Mac OS X 10.5 - 1.5
  70          * @since Java for Mac OS X 10.5 Update 1 - 1.6
  71      */
  72     public static final short kSystemDomain = -32766;
  73     /**
  74      * All users of a single machine have access to these resources.
  75      * @since Java for Mac OS X 10.5 - 1.5
  76          * @since Java for Mac OS X 10.5 Update 1 - 1.6
  77      */
  78     public static final short kLocalDomain = -32765;


< prev index next >