]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - argeo/cms/internal/backup/BackupFileSystemManager.java
2 * Copyright (C) 2007-2012 Argeo GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.argeo
.cms
.internal
.backup
;
18 import org
.apache
.commons
.vfs2
.FileSystemException
;
19 import org
.apache
.commons
.vfs2
.impl
.DefaultFileSystemManager
;
20 import org
.apache
.commons
.vfs2
.provider
.bzip2
.Bzip2FileProvider
;
21 import org
.apache
.commons
.vfs2
.provider
.ftp
.FtpFileProvider
;
22 import org
.apache
.commons
.vfs2
.provider
.gzip
.GzipFileProvider
;
23 import org
.apache
.commons
.vfs2
.provider
.local
.DefaultLocalFileProvider
;
24 import org
.apache
.commons
.vfs2
.provider
.ram
.RamFileProvider
;
25 import org
.apache
.commons
.vfs2
.provider
.sftp
.SftpFileProvider
;
26 import org
.apache
.commons
.vfs2
.provider
.url
.UrlFileProvider
;
27 import org
.argeo
.cms
.CmsException
;
30 * Programatically configured VFS file system manager which can be declared as a
31 * bean and associated with a life cycle (methods
32 * {@link DefaultFileSystemManager#init()} and
33 * {@link DefaultFileSystemManager#closet()}). Supports bz2, file, ram, gzip,
36 public class BackupFileSystemManager
extends DefaultFileSystemManager
{
38 public BackupFileSystemManager() {
41 addProvider("file", new DefaultLocalFileProvider());
42 addProvider("bz2", new Bzip2FileProvider());
43 addProvider("ftp", new FtpFileProvider());
44 addProvider("sftp", new SftpFileProvider());
45 addProvider("gzip", new GzipFileProvider());
46 addProvider("ram", new RamFileProvider());
47 setDefaultProvider(new UrlFileProvider());
48 } catch (FileSystemException e
) {
49 throw new CmsException("Cannot configure backup file provider", e
);