Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 86601 Details for
Bug 209593
[api] Add support for "file permissions" and "owner" properties for unix files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
updated patch
patch.txt (text/plain), 10.95 KB, created by
David McKnight
on 2008-01-10 15:30:59 EST
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
David McKnight
Created:
2008-01-10 15:30:59 EST
Size:
10.95 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.services >Index: src/org/eclipse/rse/services/files/HostFilePermissions.java >=================================================================== >RCS file: src/org/eclipse/rse/services/files/HostFilePermissions.java >diff -N src/org/eclipse/rse/services/files/HostFilePermissions.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/rse/services/files/HostFilePermissions.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,59 @@ >+/******************************************************************************** >+ * Copyright (c) 2008 IBM Corporation. All rights reserved. >+ * This program and the accompanying materials are made available under the terms >+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is >+ * available at http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Initial Contributors: >+ * The following IBM employees contributed to the Remote System Explorer >+ * component that contains this file: David McKnight. >+ * >+ * Contributors: >+ * {Name} (company) - description of contribution. >+ ********************************************************************************/ >+package org.eclipse.rse.services.files; >+ >+/** >+ * Implementation of IHostFilePermissions. >+ * >+ */ >+public class HostFilePermissions implements >+ IHostFilePermissions { >+ >+ private int _permissions = 0; >+ >+ public HostFilePermissions(int initialPermissions){ >+ _permissions = initialPermissions; >+ } >+ >+ private boolean isSet(long mask) { >+ return (_permissions & mask) != 0; >+ } >+ >+ private void set(int mask) { >+ _permissions |= mask; >+ } >+ >+ private void clear(int mask) { >+ _permissions &= ~mask; >+ } >+ >+ public void setPermission(int permission, boolean value) { >+ if (value) >+ set(permission); >+ else >+ clear(permission); >+ } >+ >+ public boolean getPermission(int permission) { >+ return isSet(permission); >+ } >+ >+ public int getPermissionBits() { >+ return _permissions; >+ } >+ >+ public void setPermissionBits(int bits) { >+ _permissions = bits; >+ } >+} >Index: src/org/eclipse/rse/services/files/IHostFilePermissions.java >=================================================================== >RCS file: src/org/eclipse/rse/services/files/IHostFilePermissions.java >diff -N src/org/eclipse/rse/services/files/IHostFilePermissions.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/rse/services/files/IHostFilePermissions.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,117 @@ >+/******************************************************************************** >+ * Copyright (c) 2008 IBM Corporation. All rights reserved. >+ * This program and the accompanying materials are made available under the terms >+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is >+ * available at http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Initial Contributors: >+ * The following IBM employees contributed to the Remote System Explorer >+ * component that contains this file: David McKnight. >+ * >+ * Contributors: >+ * {Name} (company) - description of contribution. >+ ********************************************************************************/ >+package org.eclipse.rse.services.files; >+ >+ >+public interface IHostFilePermissions { >+ >+ /** >+ * Permission constant indicating that >+ * the user can read this file >+ */ >+ public static final int PERM_USER_READ = 1 << 8; >+ >+ /** >+ * Permission constant indicating that >+ * the user can write to this file >+ */ >+ public static final int PERM_USER_WRITE = 1 << 7; >+ >+ /** >+ * Permission constant indicating that >+ * the user can execute this file >+ */ >+ public static final int PERM_USER_EXECUTE = 1 << 6; >+ >+ /** >+ * Permission constant indicating that >+ * the group can read this file >+ */ >+ public static final int PERM_GROUP_READ = 1 << 5; >+ >+ /** >+ * Permission constant indicating that >+ * the group can write to this file >+ * >+ */ >+ public static final int PERM_GROUP_WRITE = 1 << 4; >+ >+ /** >+ * Permission constant indicating that >+ * the group can execute this file >+ * >+ */ >+ public static final int PERM_GROUP_EXECUTE = 1 << 3; >+ >+ /** >+ * Permission constant indicating that >+ * other users can read this file >+ * >+ */ >+ public static final int PERM_OTHER_READ = 1 << 2; >+ >+ /** >+ * Permission constant indicating that >+ * other users can write to this file >+ * >+ */ >+ public static final int PERM_OTHER_WRITE = 1 << 1; >+ >+ /** >+ * Permission constant indicating that >+ * other users can execute to this file >+ * >+ */ >+ public static final int PERM_OTHER_EXECUTE = 1 << 0; >+ >+ >+ // support masks >+ public static final int PERM_ANY_READ = PERM_USER_READ | PERM_GROUP_READ | PERM_OTHER_READ; >+ public static final int PERM_ANY_WRITE = PERM_USER_WRITE | PERM_GROUP_WRITE | PERM_OTHER_WRITE; >+ public static final int PERM_ANY_EXECUTE = PERM_USER_EXECUTE | PERM_GROUP_EXECUTE | PERM_OTHER_EXECUTE; >+ >+ /** >+ * Set or reset all the permission bits from the given bitmask. >+ * >+ * @param bitmask the permission(s) bits to modify >+ * @param value whether to turn on off of the permission(s) >+ * >+ * Example: setPermission(PERM_USER_WRITE | PERM_GROUP_WRITE, true); >+ */ >+ public void setPermission(int bitmask, boolean value); >+ >+ /** >+ * Test if any of the permission bits from the bitmask are set. >+ * >+ * @param bitmask the permission(s) to check for >+ * @return true if one of the permission bits is set >+ * >+ * Example: getPermission(PERM_USER_WRITE | PERM_GROUP_WRITE) >+ */ >+ public boolean getPermission(int bitmask); >+ >+ /** >+ * Get the set of permission bits. >+ * >+ * @return set of permission bits >+ */ >+ public int getPermissionBits(); >+ >+ /** >+ * Set the permission bits >+ * @param bits the set of permission bits >+ */ >+ public void setPermissionBits(int bits); >+ >+} >Index: src/org/eclipse/rse/services/files/IFileOwnerService.java >=================================================================== >RCS file: src/org/eclipse/rse/services/files/IFileOwnerService.java >diff -N src/org/eclipse/rse/services/files/IFileOwnerService.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/rse/services/files/IFileOwnerService.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,51 @@ >+/******************************************************************************** >+ * Copyright (c) 2008 IBM Corporation. All rights reserved. >+ * This program and the accompanying materials are made available under the terms >+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is >+ * available at http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Initial Contributors: >+ * The following IBM employees contributed to the Remote System Explorer >+ * component that contains this file: David McKnight. >+ * >+ * Contributors: >+ * {Name} (company) - description of contribution. >+ ********************************************************************************/ >+package org.eclipse.rse.services.files; >+ >+import org.eclipse.core.runtime.IProgressMonitor; >+ >+import org.eclipse.rse.services.clientserver.messages.SystemMessageException; >+ >+/** >+ * Service used to get and set the owner of a file. >+ */ >+public interface IFileOwnerService { >+ /** >+ * @param remoteParent >+ * @param name >+ * @param monitor the monitor for this potentially long running operation >+ * @return the host file owner >+ * @throws SystemMessageException if an error occurs. >+ * Typically this would be one of those in the RemoteFileException family. >+ */ >+ public String getFileOwner(String remoteParent, String name, IProgressMonitor monitor) throws SystemMessageException; >+ >+ /** >+ * @param remoteParent >+ * @param name >+ * @param monitor the monitor for this potentially long running operation >+ * @throws SystemMessageException if an error occurs. >+ * Typically this would be one of those in the RemoteFileException family. >+ */ >+ public void setFileOwner(String remoteParent, String name, String newOwner, IProgressMonitor monitor) throws SystemMessageException; >+ >+ /** >+ * Indicates whether the file owner can be set for the specified file >+ * >+ * @param remoteParent the >+ * @param name >+ * @return whether the file owner can be set >+ */ >+ public boolean canSetFileOwner(String remoteParent, String name); >+} >Index: src/org/eclipse/rse/services/files/IFilePermissionsService.java >=================================================================== >RCS file: src/org/eclipse/rse/services/files/IFilePermissionsService.java >diff -N src/org/eclipse/rse/services/files/IFilePermissionsService.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/rse/services/files/IFilePermissionsService.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,53 @@ >+/******************************************************************************** >+ * Copyright (c) 2008 IBM Corporation. All rights reserved. >+ * This program and the accompanying materials are made available under the terms >+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is >+ * available at http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Initial Contributors: >+ * The following IBM employees contributed to the Remote System Explorer >+ * component that contains this file: David McKnight. >+ * >+ * Contributors: >+ * {Name} (company) - description of contribution. >+ ********************************************************************************/ >+package org.eclipse.rse.services.files; >+ >+import org.eclipse.core.runtime.IProgressMonitor; >+ >+import org.eclipse.rse.services.clientserver.messages.SystemMessageException; >+ >+/** >+ * Service used to get and set the permissions of a file. >+ */ >+public interface IFilePermissionsService { >+ >+ /** >+ * @param remoteParent >+ * @param name >+ * @param monitor the monitor for this potentially long running operation >+ * @return the host file permissions >+ * @throws SystemMessageException if an error occurs. >+ * Typically this would be one of those in the RemoteFileException family. >+ */ >+ public IHostFilePermissions getFilePermissions(String remoteParent, String name, IProgressMonitor monitor) throws SystemMessageException; >+ >+ /** >+ * @param remoteParent >+ * @param name >+ * @param permissions the new permissions for this file >+ * @param monitor the monitor for this potentially long running operation >+ * @throws SystemMessageException if an error occurs. >+ * Typically this would be one of those in the RemoteFileException family. >+ */ >+ public void setFilePermissions(String remoteParent, String name, IHostFilePermissions permissions, IProgressMonitor monitor) throws SystemMessageException; >+ >+ /** >+ * Indicates whether the file permissions can be set for the specified file >+ * >+ * @param remoteParent the >+ * @param name >+ * @return whether the file permissions can be set >+ */ >+ public boolean canSetFilePermissions(String remoteParent, String name); >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 209593
:
86557
|
86578
|
86584
|
86601
|
86697
|
86714
|
86959
|
87427
|
87539