static public AttemptResult AttemptReadObjectIfExists <T>(this StreamSystem item, string path, ref T to_read, long milliseconds = StreamSystem.DEFAULT_WAIT) { if (item.DoesStreamExist(path)) { return(item.AttemptReadObject <T>(path, out to_read, milliseconds)); } return(AttemptResult.Unneeded); }
public virtual AttemptResult CopyStreamForeign(string src_path, StreamSystem dst, string dst_path, bool overwrite, long milliseconds = StreamSystem.DEFAULT_WAIT) { if (overwrite || dst.DoesStreamExist(dst_path) == false) { return(dst.Write(dst_path, delegate(Stream stream) { return this.AttemptReadIntoStream(src_path, stream, milliseconds); }, milliseconds)); } return(AttemptResult.Failed); }
static public AttemptResult Move(this StreamSystem item, string src_path, StreamSystem dst, string dst_path, bool overwrite, long milliseconds = StreamSystem.DEFAULT_WAIT) { if (item.DoesStreamExist(src_path)) { return(item.MoveStream(src_path, dst, dst_path, overwrite, milliseconds)); } if (item.DoesDirectoryExist(src_path)) { return(item.MoveDirectory(src_path, dst, dst_path, overwrite, milliseconds)); } return(AttemptResult.Failed); }
static public bool DoesExist(this StreamSystem item, string path) { if (item.DoesStreamExist(path)) { return(true); } if (item.DoesDirectoryExist(path)) { return(true); } return(false); }
static public AttemptResult Rename(this StreamSystem item, string path, string new_name, bool overwrite, long milliseconds = StreamSystem.DEFAULT_WAIT) { if (item.DoesStreamExist(path)) { return(item.RenameStream(path, new_name, overwrite, milliseconds)); } if (item.DoesDirectoryExist(path)) { return(item.RenameDirectory(path, new_name, overwrite, milliseconds)); } return(AttemptResult.Failed); }
static public AttemptResult Delete(this StreamSystem item, string path, long milliseconds = StreamSystem.DEFAULT_WAIT) { if (item.DoesStreamExist(path)) { return(item.DeleteStream(path, milliseconds)); } if (item.DoesDirectoryExist(path)) { return(item.DeleteDirectory(path, milliseconds)); } return(AttemptResult.Failed); }
public override bool DoesStreamExist(string path) { return(stream_system.DoesStreamExist(CalculatePath(path))); }