Exemplo n.º 1
0
        public bool Delete(string name)
        {
            if (name.Split(new[] { '/', '\\' }, StringSplitOptions.RemoveEmptyEntries).Length == 1)
            {
                throw ClientException(D.UNABE_TO_DELETE_SYSTEM_DIRECTORY);
            }

            try
            {
                IIOContext io   = IOContext.Current;
                string     path = io.TranslateLocalPath(name);

                return(io.Delete(path));
            }
            catch (CustomException e)
            {
                throw ClientException(e.FriendlyMessage);
            }
            catch (ArgumentException)
            {
                throw ClientException(D.INVALID_PATH + ": " + name);
            }
            catch (Exception e)
            {
                HandleException(e, "Delete");
                throw ClientException(D.UNEXPECTED_ERROR_OCCURED);
            }
        }
Exemplo n.º 2
0
 public void ClearPrivate()
 {
     try
     {
         IIOContext io = IOContext.Current;
         io.Delete(Path.Combine(_io.LocalStorage, io.PrivateDirectory));
     }
     catch (Exception e)
     {
         HandleException(e, "ClearPrivate");
     }
 }