All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aoindustries.aoserv.backup.LinuxEnvironment Maven / Gradle / Ivy

/*
 * aoserv-backup - Backup client for the AOServ Platform.
 * Copyright (C) 2008, 2009, 2018, 2019, 2021, 2022  AO Industries, Inc.
 *     [email protected]
 *     7262 Bull Pen Cir
 *     Mobile, AL 36695
 *
 * This file is part of aoserv-backup.
 *
 * aoserv-backup 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 3 of the License, or
 * (at your option) any later version.
 *
 * aoserv-backup 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 aoserv-backup.  If not, see .
 */

package com.aoindustries.aoserv.backup;

import com.aoapps.hodgepodge.io.FilesystemIteratorRule;
import com.aoindustries.aoserv.client.backup.FileReplication;
import java.io.IOException;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

/**
 * A LinuxEnvironment extends PosixFileEnvironment to
 * have some default exclusions, such as /proc/.
 *
 * @author  AO Industries, Inc.
 */
public abstract class LinuxEnvironment extends PosixFileEnvironment {

  @Override
  protected Map getFilesystemIteratorRules(FileReplication ffr) throws IOException, SQLException {
    Map filesystemRules = new HashMap<>();
    filesystemRules.put("/dev/log", FilesystemIteratorRule.SKIP);
    filesystemRules.put("/dev/pts/", FilesystemIteratorRule.SKIP);
    filesystemRules.put("/dev/shm/", FilesystemIteratorRule.SKIP);
    filesystemRules.put("/proc/", FilesystemIteratorRule.SKIP);
    filesystemRules.put("/selinux/", FilesystemIteratorRule.SKIP);
    filesystemRules.put("/sys/", FilesystemIteratorRule.SKIP);
    return filesystemRules;
  }

  @Override
  protected Map getFilesystemIteratorPrefixRules(FileReplication ffr) throws IOException, SQLException {
    Map filesystemPrefixRules = new HashMap<>();
    return filesystemPrefixRules;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy