Files
duplicati/Duplicati/Library/Interface/CustomExceptions.cs
T
kenneth.skovhede@gmail.com 6cbe503d28 The logic for missing folders on the backends have changed.
Previously some backends autocreated a missing folder, and some threw an exception.

The new standard is that all backends throw the FolderMissingException on all access (except delete).
This means that the Test() and List() methods are now the same for all stock backends.
Third-party applications that use the backends should implement custom logic to auto-create the folders,
when the FolderMissingException is encountered.

Duplicati auto-creates missing folders, but this can be toggled through the new flag --disable-autocreate-folders.
In case the auto-create fails to detect a missing folder, there is now a "create-folder" action in the commandline version.

Update issue #102
Status: Fixed
The IBackend_v2 interface has the CreateFolder and Test methods.
The CreateFolder is exposed to the commandline interface with the action create-folder.

git-svn-id: https://duplicati.googlecode.com/svn/trunk@558 59da171f-624f-0410-aa54-27559c288bec
2010-10-23 11:40:43 +00:00

92 lines
3.0 KiB
C#

#region Disclaimer / License
// Copyright (C) 2010, Kenneth Skovhede
// http://www.hexad.dk, opensource@hexad.dk
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#endregion
using System;
using System.Collections.Generic;
using System.Text;
namespace Duplicati.Library.Interface
{
/// <summary>
/// An exception indicating that the requested folder is missing
/// </summary>
public class FolderMissingException : Exception
{
public FolderMissingException()
: base(Strings.Common.FolderMissingError)
{ }
public FolderMissingException(string message)
: base(message)
{ }
public FolderMissingException(Exception innerException)
: base(Strings.Common.FolderMissingError, innerException)
{ }
public FolderMissingException(string message, Exception innerException)
: base(message, innerException)
{ }
}
/// <summary>
/// An exception indicating that the requested folder already existed
/// </summary>
public class FolderAreadyExistedException : Exception
{
public FolderAreadyExistedException()
: base(Strings.Common.FolderAlreadyExistsError)
{ }
public FolderAreadyExistedException(string message)
: base(message)
{ }
public FolderAreadyExistedException(Exception innerException)
: base(Strings.Common.FolderAlreadyExistsError, innerException)
{ }
public FolderAreadyExistedException(string message, Exception innerException)
: base(message, innerException)
{ }
}
/// <summary>
/// An exception indicating that the user has cancelled the action
/// </summary>
public class CancelException : Exception
{
public CancelException()
: base()
{ }
public CancelException(string message)
: base(message)
{ }
public CancelException(Exception innerException)
: base(Strings.Common.CancelExceptionError, innerException)
{ }
public CancelException(string message, Exception innerException)
: base(message, innerException)
{ }
}
}