You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/04/23 19:56:57 UTC

svn commit: r767997 - in /commons/sandbox/runtime/trunk/src/main: java/org/apache/commons/runtime/ java/org/apache/commons/runtime/io/ java/org/apache/commons/runtime/platform/windows/ native/include/

Author: mturk
Date: Thu Apr 23 17:56:57 2009
New Revision: 767997

URL: http://svn.apache.org/viewvc?rev=767997&view=rev
Log:
Add some enums

Added:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileAttributes.java   (with props)
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileOpenMode.java   (with props)
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileProtection.java   (with props)
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/KeyAccessRights.java   (with props)
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryValueType.java   (with props)
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/VariantType.java   (with props)
Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLockType.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/HKEY.java
    commons/sandbox/runtime/trunk/src/main/native/include/acr_file.h

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java?rev=767997&r1=767996&r2=767997&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java Thu Apr 23 17:56:57 2009
@@ -130,7 +130,7 @@
      * @return a {@code byte} at {@code index}.
      * @throws IndexOutOfBoundsException if {@code index} would cause access
      *          outside the pointer address space.
-     * @thrown NullPointerException if pointer is {@code null}.
+     * @throws NullPointerException if pointer is {@code null}.
      */
     public abstract int peek(int index)
         throws IndexOutOfBoundsException, NullPointerException;
@@ -142,7 +142,7 @@
      * @param value Value to set at {@code index}.
      * @throws IndexOutOfBoundsException if {@code index} would cause access
      *          outside the pointer address space.
-     * @thrown NullPointerException if pointer is {@code null}.
+     * @throws NullPointerException if pointer is {@code null}.
      */
     public abstract void poke(int index, int value)
         throws IndexOutOfBoundsException, NullPointerException;

Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileAttributes.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileAttributes.java?rev=767997&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileAttributes.java (added)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileAttributes.java Thu Apr 23 17:56:57 2009
@@ -0,0 +1,76 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.runtime.io;
+
+import java.util.EnumSet;
+
+/**
+ * File attributes flag flags.
+ */
+public enum FileAttributes
+{
+    /** File is read-only */
+    READ(       0x01),
+    /** File is executable */
+    EXCUTABLE(  0x02),
+    /** File is hidden */
+    HIDDEN(     0x04);
+
+    private int value;
+    private FileAttributes(int v)
+    {
+        value = v;
+    }
+
+    public int valueOf()
+    {
+        return value;
+    }
+
+    /**
+     * Integer representing the sum of the integer values
+     * of the {@code FileAttributes} enums.
+     * @param set The {@code EnumSet} which values to get.
+     * @return sum of {@code FileAttributes} values
+     */
+    public static int bitmapOf(EnumSet<FileAttributes> set)
+    {
+        int bitmap = 0;
+        if (set != null) {
+            for (FileAttributes a : set)
+                bitmap += a.valueOf();
+        }
+        return bitmap;
+    }
+
+    /**
+     * Returns {@code EnumSet} of {@code FileAttributes} enums
+     * from the integer bitmap value.
+     * @param value Integer used to construct the {@code EnumSet}
+     * with {@code FileAttributes} values mathching the value flags.
+     * @return set of {@code FileAttributes} enums.
+     */
+    public static EnumSet<FileAttributes> valueOf(int value)
+    {
+        EnumSet<FileAttributes> set = EnumSet.noneOf(FileAttributes.class);
+        for (FileAttributes e : values()) {
+            if ((e.value & value) == e.value)
+                set.add(e);
+        }
+        return set;
+    }
+}

Propchange: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileAttributes.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLockType.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLockType.java?rev=767997&r1=767996&r2=767997&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLockType.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLockType.java Thu Apr 23 17:56:57 2009
@@ -54,9 +54,11 @@
         return value;
     }
 
-    /** Integer representing the sum of the integer values
+    /**
+     * Integer representing the sum of the integer values
      * of the {@code FileLockType} enums.
      * @param set The {@code EnumSet} which values to get.
+     * @return sum of {@code FileLockType} values
      */
     public static int bitmapOf(EnumSet<FileLockType> set)
     {
@@ -68,10 +70,12 @@
         return bitmap;
     }
 
-    /** Returns {@code EnumSet} of {@code FileLockType} enums
+    /**
+     * Returns {@code EnumSet} of {@code FileLockType} enums
      * from the integer bitmap value.
      * @param value Integer used to construct the {@code EnumSet}
      * with {@code FileLockType} values mathching the value flags.
+     * @return set of {@code FileLockType} enums.
      */
     public static EnumSet<FileLockType> valueOf(int value)
     {

Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileOpenMode.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileOpenMode.java?rev=767997&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileOpenMode.java (added)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileOpenMode.java Thu Apr 23 17:56:57 2009
@@ -0,0 +1,102 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.runtime.io;
+
+import java.util.EnumSet;
+
+/**
+ * File open mode flags.
+ */
+public enum FileOpenMode
+{
+    /** Open the file for reading. */
+    READ(               0x00001),
+    /** Open the file for writing. */
+    WRITE(              0x00002),
+    /** Create the file if not there. */
+    CREATE(             0x00004),
+    /** Append to the end of the file. */
+    APPEND(             0x00008),
+    /** Open the file and truncate to {@code 0} length. */
+    TRUNCATE(           0x00010),
+    /** Open the file in binary mode. */
+    BINARY(             0x00020),
+    /** Open should fail if {@code CREATE} and file exists. */
+    EXCL(               0x00040),
+    /** Open the file for buffered I/O. */
+    BUFFERED(           0x00080),
+    /** Delete the file after close. */
+    DELONCLOSE(         0x00100),
+
+    /** Platform dependent support for higher level locked read/write
+     * access to support writes across process/machines.
+     */
+    SHARELOCK(          0x00400),
+
+    /** Advisory flag that this file should support
+     * socket sendfile operation.
+     */
+    SENDFILE_ENABLED(   0x01000),
+
+    /** Platform dependent flag to enable sparse file support.
+     */
+    SPARSE(             0x08000);
+
+    private int value;
+    private FileOpenMode(int v)
+    {
+        value = v;
+    }
+
+    public int valueOf()
+    {
+        return value;
+    }
+
+    /**
+     * Integer representing the sum of the integer values
+     * of the {@code FileOpenMode} enums.
+     * @param set The {@code EnumSet} which values to get.
+     * @return sum of {@code FileOpenMode} values
+     */
+    public static int bitmapOf(EnumSet<FileOpenMode> set)
+    {
+        int bitmap = 0;
+        if (set != null) {
+            for (FileOpenMode m : set)
+                bitmap += m.valueOf();
+        }
+        return bitmap;
+    }
+
+    /**
+     * Returns {@code EnumSet} of {@code FileOpenMode} enums
+     * from the integer bitmap value.
+     * @param value Integer used to construct the {@code EnumSet}
+     * with {@code FileOpenMode} values mathching the value flags.
+     * @return set of {@code FileOpenMode} enums.
+     */
+    public static EnumSet<FileOpenMode> valueOf(int value)
+    {
+        EnumSet<FileOpenMode> set = EnumSet.noneOf(FileOpenMode.class);
+        for (FileOpenMode e : values()) {
+            if ((e.value & value) == e.value)
+                set.add(e);
+        }
+        return set;
+    }
+}

Propchange: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileOpenMode.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileProtection.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileProtection.java?rev=767997&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileProtection.java (added)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileProtection.java Thu Apr 23 17:56:57 2009
@@ -0,0 +1,99 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.runtime.io;
+
+import java.util.EnumSet;
+
+/**
+ * File protection flags.
+ */
+public enum FileProtection
+{
+    /** Set user id */
+    USETID(     0x8000),
+    /** Read by user */
+    UREAD(      0x0400),
+    /** Write by user */
+    UWRITE(     0x0200),
+    /** Execute by user */
+    UEXECUTE(   0x0100),
+
+    /** Set group id */
+    GSETID(     0x4000),
+    /** Read by group */
+    GREAD(      0x0040),
+    /** Write by group */
+    GWRITE(     0x0020),
+    /** Execute by group */
+    GEXECUTE(   0x0010),
+
+    /** Sticky bit */
+    WSTICKY(    0x2000),
+    /** Read by others */
+    WREAD(      0x0004),
+    /** Write by others */
+    WWRITE(     0x0002),
+    /** Execute by others */
+    WEXECUTE(   0x0001),
+
+    /** Use OS's default permissions */
+    OS_DEFAULT( 0x0FFF);
+
+    private int value;
+    private FileProtection(int v)
+    {
+        value = v;
+    }
+
+    public int valueOf()
+    {
+        return value;
+    }
+
+    /**
+     * Integer representing the sum of the integer values
+     * of the {@code FileProtection} enums.
+     * @param set The {@code EnumSet} which values to get.
+     * @return sum of {@code FileProtection} values
+     */
+    public static int bitmapOf(EnumSet<FileProtection> set)
+    {
+        int bitmap = 0;
+        if (set != null) {
+            for (FileProtection p : set)
+                bitmap += p.valueOf();
+        }
+        return bitmap;
+    }
+
+    /**
+     * Returns {@code EnumSet} of {@code FileProtection} enums
+     * from the integer bitmap value.
+     * @param value Integer used to construct the {@code EnumSet}
+     * with {@code FileProtection} values mathching the value flags.
+     * @return set of {@code FileProtection} enums.
+     */
+    public static EnumSet<FileProtection> valueOf(int value)
+    {
+        EnumSet<FileProtection> set = EnumSet.noneOf(FileProtection.class);
+        for (FileProtection e : values()) {
+            if ((e.value & value) == e.value)
+                set.add(e);
+        }
+        return set;
+    }
+}

Propchange: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileProtection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/HKEY.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/HKEY.java?rev=767997&r1=767996&r2=767997&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/HKEY.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/HKEY.java Thu Apr 23 17:56:57 2009
@@ -17,37 +17,43 @@
 package org.apache.commons.runtime.platform.windows;
 
 /**
+ * Registry key type enum.
+ * <p>
  * An application can use handles to these keys as entry points to the
  * registry. These handles are valid for all implementations of the
  * registry, although the use of the handles may vary from platform to
  * platform. In addition, other predefined handles have been defined
  * for specific platforms. The following are handles to the predefined
  * keys.
+ * </p>
  */
 public enum HKEY
 {
     /** Registry entries subordinate to this key define types (or classes)
      * of documents and the properties associated with those types. Shell
      * and COM applications use the information stored under this key.
-     * For more information, see HKEY_CLASSES_ROOT Key
-     * <BR/>
+     * For more information, see {@code HKEY_CLASSES_ROOT} Key.
+     * <p>
      * This key also provides backward compatibility with the Windows 3.1
      * registration database by storing information for DDE and OLE support.
      * File viewers and user interface extensions store their OLE class
-     * identifiers in HKEY_CLASSES_ROOT, and in-process servers are
+     * identifiers in {@code HKEY_CLASSES_ROOT}, and in-process servers are
      * registered in this key.
-     * <BR/>
+     * </p>
      * This handle should not be used in a service or an application that
      * impersonates different users.
      */
     CLASSES_ROOT(   1),
 
     /** Contains information about the current hardware profile of the
-     * local computer system. The information under HKEY_CURRENT_CONFIG
+     * local computer system.
+     * <p>
+     * The information under {@code HKEY_CURRENT_CONFIG}
      * describes only the differences between the current hardware
      * configuration and the standard configuration. Information about
      * the standard hardware configuration is stored under the Software
-     * and System keys of HKEY_LOCAL_MACHINE.
+     * and System keys of {@code HKEY_LOCAL_MACHINE}.
+     * </p>
      */
     CURRENT_CONFIG( 2),
 
@@ -56,7 +62,7 @@
      * environment variables, data about program groups, colors, printers,
      * network connections, and application preferences. This key makes it
      * easier to establish the current user's settings; the key maps to the
-     * current user's branch in HKEY_USERS.
+     * current user's branch in {@code HKEY_USERS}.
      */
     CURRENT_USER(   3),
 

Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/KeyAccessRights.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/KeyAccessRights.java?rev=767997&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/KeyAccessRights.java (added)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/KeyAccessRights.java Thu Apr 23 17:56:57 2009
@@ -0,0 +1,88 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.runtime.platform.windows;
+
+import java.util.EnumSet;
+
+/**
+ * Registry Key Access Rights.
+ */
+public enum KeyAccessRights
+{
+
+    /**
+     * Access is not specified.
+     */
+    NONE(               0x0000),
+
+    ALL_ACCESS(         0x0001),
+    CREATE_LINK(        0x0002),
+    CREATE_SUB_KEY(     0x0004),
+    ENUMERATE_SUB_KEYS( 0x0008),
+    EXECUTE(            0x0010),
+    NOTIFY(             0x0020),
+    QUERY_VALUE(        0x0040),
+    READ(               0x0080),
+    SET_VALUE(          0x0100),
+    WOW64_64KEY(        0x0200),
+    WOW64_32KEY(        0x0400),
+    WRITE(              0x0800);
+
+    private int value;
+    private KeyAccessRights(int v)
+    {
+        value = v;
+    }
+
+    public int valueOf()
+    {
+        return value;
+    }
+
+    /**
+     * Integer representing the sum of the integer values
+     * of the {@code KeyAccessRights} enums.
+     * @param set The {@code EnumSet} which values to get.
+     * @return sum of {@code KeyAccessRights} values
+     */
+    public static int bitmapOf(EnumSet<KeyAccessRights> set)
+    {
+        int bitmap = 0;
+        if (set != null) {
+            for (KeyAccessRights a : set)
+                bitmap += a.valueOf();
+        }
+        return bitmap;
+    }
+
+    /**
+     * Returns {@code EnumSet} of {@code KeyAccessRights} enums
+     * from the integer bitmap value.
+     * @param value Integer used to construct the {@code EnumSet}
+     * with {@code KeyAccessRights} values mathching the value flags.
+     * @return set of {@code KeyAccessRights} enums.
+     */
+    public static EnumSet<KeyAccessRights> valueOf(int value)
+    {
+        EnumSet<KeyAccessRights> set = EnumSet.noneOf(KeyAccessRights.class);
+        for (KeyAccessRights e : values()) {
+            if ((e.value & value) == e.value)
+                set.add(e);
+        }
+        return set;
+    }
+}

Propchange: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/KeyAccessRights.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryValueType.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryValueType.java?rev=767997&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryValueType.java (added)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryValueType.java Thu Apr 23 17:56:57 2009
@@ -0,0 +1,90 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.runtime.platform.windows;
+
+
+/**
+ * Type of the {@code Registry} value.
+ * <p>
+ * A registry value can store data in various formats. When you store data
+ * under a registry value, for instance by calling the {@code RegSetValueEx}
+ * function,
+ * you can specify one of the following values to indicate the type of data
+ * being stored. When you retrieve a registry value, functions such as
+ * {@code RegQueryValueEx} use these values to indicate the type of data
+ * retrieved.
+ *</p>
+ */
+public enum RegistryValueType
+{
+    /**
+     * Unknown or unsupported Registry value type.
+     */
+    UNKNOWN(    0),
+
+    /**
+     * Binary data in any form.
+     */
+    BINARY(     1),
+
+    /**
+     * A 32-bit number.
+     */
+    DWORD(      2),
+
+    /**
+     * Null-terminated string that contains unexpanded references to
+     * environment variables (for example, {@code %PATH%"}).
+     */
+    EXPAND_SZ(  3),
+
+    /**
+     * Array of null-terminated strings, terminated by two null characters.
+     */
+    MULTI_SZ(   4),
+
+    /**
+     * A 64-bit number.
+     */
+    QWORD(      5),
+
+    /**
+     * Null-terminated string
+     */
+    SZ(         6);
+
+    private int value;
+    private RegistryValueType(int v)
+    {
+        value = v;
+    }
+
+    public int valueOf()
+    {
+        return value;
+    }
+
+    public static RegistryValueType valueOf(int value)
+    {
+        for (RegistryValueType e : values()) {
+            if (e.value == value)
+                return e;
+        }
+        return UNKNOWN;
+    }
+
+}

Propchange: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryValueType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/VariantType.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/VariantType.java?rev=767997&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/VariantType.java (added)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/VariantType.java Thu Apr 23 17:56:57 2009
@@ -0,0 +1,102 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.runtime.platform.windows;
+
+
+/**
+ * VariantType enumeration.
+ * <p>
+ * The {@code VARIANT} structure is a container for a large union that
+ * carries many types of data.
+ * </p>
+ */
+public enum VariantType
+{
+    VT_EMPTY            (0),
+    VT_NULL             (1),
+    VT_I2               (2),
+    VT_I4               (3),
+    VT_R4               (4),
+    VT_R8               (5),
+    VT_CY               (6),
+    VT_DATE             (7),
+    VT_BSTR             (8),
+    VT_DISPATCH         (9),
+    VT_ERROR            (10),
+    VT_BOOL             (11),
+    VT_VARIANT          (12),
+    VT_UNKNOWN          (13),
+    VT_DECIMAL          (14),
+    VT_I1               (16),
+    VT_UI1              (17),
+    VT_UI2              (18),
+    VT_UI4              (19),
+    VT_I8               (20),
+    VT_UI8              (21),
+    VT_INT              (22),
+    VT_UINT             (23),
+    VT_VOID             (24),
+    VT_HRESULT          (25),
+    VT_PTR              (26),
+    VT_SAFEARRAY        (27),
+    VT_CARRAY           (28),
+    VT_USERDEFINED      (29),
+    VT_LPSTR            (30),
+    VT_LPWSTR           (31),
+    VT_RECORD           (36),
+    VT_INT_PTR          (37),
+    VT_UINT_PTR         (38),
+    VT_FILETIME         (64),
+    VT_BLOB             (65),
+    VT_STREAM           (66),
+    VT_STORAGE          (67),
+    VT_STREAMED_OBJECT  (68),
+    VT_STORED_OBJECT    (69),
+    VT_BLOB_OBJECT      (70),
+    VT_CF               (71),
+    VT_CLSID            (72),
+    VT_VERSIONED_STREAM (73),
+    VT_BSTR_BLOB        (0x0fff),
+    VT_VECTOR           (0x1000),
+    VT_ARRAY            (0x2000),
+    VT_BYREF            (0x4000),
+    VT_RESERVED         (0x8000),
+    VT_ILLEGAL          (0xffff),
+    VT_ILLEGALMASKED    (0x0fff),
+    VT_TYPEMASK         (0x0fff);
+
+    private int value;
+    private VariantType(int v)
+    {
+        value = v;
+    }
+
+    public int valueOf()
+    {
+        return value;
+    }
+
+    public static VariantType valueOf(int value)
+    {
+        for (VariantType e : values()) {
+            if (e.value == value)
+                return e;
+        }
+        return VT_EMPTY;
+    }
+
+}

Propchange: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/VariantType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_file.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_file.h?rev=767997&r1=767996&r2=767997&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr_file.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr_file.h Thu Apr 23 17:56:57 2009
@@ -41,6 +41,96 @@
 #define ACR_FT_SOCK       7    /**< a [unix domain] socket */
 #define ACR_FT_UNKFILE  127    /**< a file of some other unknown type */
 
+/**
+ * @defgroup apr_file_permissions File Permissions flags 
+ * @{
+ */
+
+#define ACR_FPROT_USETID      0x8000 /**< Set user id */
+#define ACR_FPROT_UREAD       0x0400 /**< Read by user */
+#define ACR_FPROT_UWRITE      0x0200 /**< Write by user */
+#define ACR_FPROT_UEXECUTE    0x0100 /**< Execute by user */
+
+#define ACR_FPROT_GSETID      0x4000 /**< Set group id */
+#define ACR_FPROT_GREAD       0x0040 /**< Read by group */
+#define ACR_FPROT_GWRITE      0x0020 /**< Write by group */
+#define ACR_FPROT_GEXECUTE    0x0010 /**< Execute by group */
+
+#define ACR_FPROT_WSTICKY     0x2000 /**< Sticky bit */
+#define ACR_FPROT_WREAD       0x0004 /**< Read by others */
+#define ACR_FPROT_WWRITE      0x0002 /**< Write by others */
+#define ACR_FPROT_WEXECUTE    0x0001 /**< Execute by others */
+
+#define ACR_FPROT_OS_DEFAULT  0x0FFF /**< use OS's default permissions */
+
+/* additional permission flags for apr_file_copy  and apr_file_append */
+#define ACR_FPROT_FILE_SOURCE_PERMS 0x1000 /**< Copy source file's permissions */
+
+/**
+ * @defgroup apr_file_open_flags File Open Flags/Routines
+ * @{
+ */
+
+/* Removed XTHREAD and LARGEFILE */
+
+#define ACR_FOPEN_READ       0x00001  /**< Open the file for reading */
+#define ACR_FOPEN_WRITE      0x00002  /**< Open the file for writing */
+#define ACR_FOPEN_CREATE     0x00004  /**< Create the file if not there */
+#define ACR_FOPEN_APPEND     0x00008  /**< Append to the end of the file */
+#define ACR_FOPEN_TRUNCATE   0x00010  /**< Open the file and truncate
+                                         to 0 length */
+#define ACR_FOPEN_BINARY     0x00020  /**< Open the file in binary mode */
+#define ACR_FOPEN_EXCL       0x00040  /**< Open should fail if APR_CREATE
+                                         and file exists. */
+#define ACR_FOPEN_BUFFERED   0x00080  /**< Open the file for buffered I/O */
+#define ACR_FOPEN_DELONCLOSE 0x00100  /**< Delete the file after close */
+
+#define ACR_FOPEN_SHARELOCK  0x00400  /**< Platform dependent support for
+                                         higher level locked read/write
+                                         access to support writes across
+                                         process/machines */
+#define ACR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
+                                         when the file is opened */
+#define ACR_FOPEN_SENDFILE_ENABLED 0x01000 /**< Advisory flag that this
+                                             file should support
+                                             apr_socket_sendfile operation */
+#define ACR_FOPEN_SPARSE      0x08000 /**< Platform dependent flag to enable
+                                       * sparse file support, see WARNING below
+                                       */
+/**
+ * @defgroup apr_file_attrs_set_flags File Attribute Flags
+ * @{
+ */
+
+/* flags for apr_file_attrs_set */
+#define ACR_FILE_ATTR_READONLY   0x01          /**< File is read-only */
+#define ACR_FILE_ATTR_EXECUTABLE 0x02          /**< File is executable */
+#define ACR_FILE_ATTR_HIDDEN     0x04          /**< File is hidden */
+/** @} */
+
+/* File lock types/flags */
+/**
+ * @defgroup apr_file_lock_types File Lock Types
+ * @{
+ */
+
+#define ACR_FLOCK_SHARED        1       /**< Shared lock. More than one process
+                                           or thread can hold a shared lock
+                                           at any given time. Essentially,
+                                           this is a "read lock", preventing
+                                           writers from establishing an
+                                           exclusive lock. */
+#define ACR_FLOCK_EXCLUSIVE     2       /**< Exclusive lock. Only one process
+                                           may hold an exclusive lock at any
+                                           given time. This is analogous to
+                                           a "write lock". */
+
+#define ACR_FLOCK_TYPEMASK      0x000F  /**< mask to extract lock type */
+#define ACR_FLOCK_NONBLOCK      0x0010  /**< do not block while acquiring the
+                                           file lock */
+/** @} */
+
+
 /** Get FileType
  * @param env JNI environment to use. If NULL no exception will be thrown
  *            if stat fails.