/// <summary>Copy constructor</summary> /// <param name="other">other permission</param> public FsPermission(Org.Apache.Hadoop.FS.Permission.FsPermission other) { this.useraction = other.useraction; this.groupaction = other.groupaction; this.otheraction = other.otheraction; this.stickyBit = other.stickyBit; }
/// <summary>Apply a umask to this permission and return a new one.</summary> /// <remarks> /// Apply a umask to this permission and return a new one. /// The umask is used by create, mkdir, and other Hadoop filesystem operations. /// The mode argument for these operations is modified by removing the bits /// which are set in the umask. Thus, the umask limits the permissions which /// newly created files and directories get. /// </remarks> /// <param name="umask">The umask to use</param> /// <returns>The effective permission</returns> public virtual Org.Apache.Hadoop.FS.Permission.FsPermission ApplyUMask(Org.Apache.Hadoop.FS.Permission.FsPermission umask) { return(new Org.Apache.Hadoop.FS.Permission.FsPermission(useraction.And(umask.useraction .Not()), groupaction.And(umask.groupaction.Not()), otheraction.And(umask.otheraction .Not()))); }
/// <summary> /// Create and initialize a /// <see cref="FsPermission"/> /// from /// <see cref="System.IO.BinaryReader"/> /// . /// </summary> /// <exception cref="System.IO.IOException"/> public static Org.Apache.Hadoop.FS.Permission.FsPermission Read(BinaryReader reader) { Org.Apache.Hadoop.FS.Permission.FsPermission p = new Org.Apache.Hadoop.FS.Permission.FsPermission (); p.ReadFields(@in); return(p); }
public override bool Equals(object obj) { if (obj is Org.Apache.Hadoop.FS.Permission.FsPermission) { Org.Apache.Hadoop.FS.Permission.FsPermission that = (Org.Apache.Hadoop.FS.Permission.FsPermission )obj; return(this.useraction == that.useraction && this.groupaction == that.groupaction && this.otheraction == that.otheraction && this.stickyBit == that.stickyBit); } return(false); }
/// <summary>Set the user file creation mask (umask)</summary> public static void SetUMask(Configuration conf, Org.Apache.Hadoop.FS.Permission.FsPermission umask) { conf.Set(UmaskLabel, string.Format("%1$03o", umask.ToShort())); conf.SetInt(DeprecatedUmaskLabel, umask.ToShort()); }