Ejemplo n.º 1
0
 /// <nodoc/>
 public FileMaterializationInfo GetFileMaterializationInfo(PathTable pathTable)
 {
     return new FileMaterializationInfo(
         new FileContentInfo(ContentHash.ToContentHash(), FileContentInfo.LengthAndExistence.Deserialize(Length)),
         !string.IsNullOrEmpty(FileName) ? PathAtom.Create(pathTable.StringTable, FileName) : PathAtom.Invalid,
         ReparsePointInfo.Create(ReparsePointType.ToReparsePointType(), ReparsePointTarget));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates ReparsePointInfo from a string representation of target path.
        /// </summary>
        public static ReparsePointInfo Create(ReparsePointType reparsePointType, string targetPath)
        {
            Contract.Requires(!reparsePointType.IsActionable() || !string.IsNullOrEmpty(targetPath));

            if (!reparsePointType.IsActionable())
            {
                return(CreateNoneReparsePoint());
            }

            return(new ReparsePointInfo(reparsePointType, targetPath));
        }
Ejemplo n.º 3
0
        /// <nodoc />
        public static BondReparsePointType ToBondReparsePointType(this ReparsePointType reparsePointType)
        {
            switch (reparsePointType)
            {
            case ReparsePointType.None:
                return(BondReparsePointType.None);

            case ReparsePointType.SymLink:
                return(BondReparsePointType.SymLink);

            case ReparsePointType.MountPoint:
                return(BondReparsePointType.MountPoint);

            case ReparsePointType.NonActionable:
                return(BondReparsePointType.NonActionable);

            default:
                throw Contract.AssertFailure("Cannot convert ReparsePointType to BondReparsePointType");
            }
        }
Ejemplo n.º 4
0
 /// <inheritdoc />
 public bool IsReparsePointActionable(ReparsePointType reparsePointType)
 {
     Contract.Requires(reparsePointType != ReparsePointType.MountPoint, "Currently, ReparsePointType.MountPoint is not a valid reparse point type on macOS/Unix");
     return(reparsePointType == ReparsePointType.SymLink);
 }
Ejemplo n.º 5
0
 /// <see cref="IFileSystem.IsReparsePointActionable(ReparsePointType)"/>
 public static bool IsReparsePointActionable(ReparsePointType reparsePointType)
 {
     return(s_fileSystem.IsReparsePointActionable(reparsePointType));
 }
Ejemplo n.º 6
0
 private ReparsePointInfo(ReparsePointType reparsePointType, string targetPath)
 {
     ReparsePointType = reparsePointType;
     m_targetString   = targetPath;
 }
Ejemplo n.º 7
0
 private static bool IsMicrosoftReparseTag(ReparsePointType tag)
 {
     return ((uint)(tag) & 0x80000000) != 0;
 }
Ejemplo n.º 8
0
 public LinkReparsePointInfo(ReparsePointType type, string path, string target)
     : base(path, type)
 {
     this.target = ReparsePointHelper.MakeParsedPath(target);
 }
Ejemplo n.º 9
0
 protected internal ReparsePointInfo(string path, ReparsePointType tag)
 {
     this.path = path;
     this.tag = tag;
 }
Ejemplo n.º 10
0
 /// <inheritdoc />
 public bool IsReparsePointActionable(ReparsePointType reparsePointType)
 {
     return(reparsePointType == ReparsePointType.SymLink);
 }
Ejemplo n.º 11
0
 private static bool IsMicrosoftReparseTag(ReparsePointType tag)
 {
     return(((uint)(tag) & 0x80000000) != 0);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Checks whether the reparse point is actionable, i.e., a mount point or a symlink.
 /// </summary>
 public static bool IsActionable(this ReparsePointType reparsePointType)
 {
     return(FileUtilities.IsReparsePointActionable(reparsePointType));
 }
Ejemplo n.º 13
0
 public LinkReparsePointInfo(ReparsePointType type, string path, string target)
     : base(path, type)
 {
     this.target = ReparsePointHelper.MakeParsedPath(target);
 }
Ejemplo n.º 14
0
 protected internal ReparsePointInfo(string path, ReparsePointType tag)
 {
     this.path = path;
     this.tag  = tag;
 }