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

ru.r2cloud.apt.AptRepository Maven / Gradle / Ivy

The newest version!
package ru.r2cloud.apt;

import java.io.IOException;
import java.util.List;
import java.util.Set;

import ru.r2cloud.apt.model.Architecture;
import ru.r2cloud.apt.model.DebFile;
import ru.r2cloud.apt.model.ValidationError;

/**
 * Main entry point to the library. Typical program include:
 * 
 * 
 * {@code
 * GpgSigner signer = new GpgSignerImpl(config);
 * Transport transport = new FileTransport("./apt-basedir/");
 * AptRepository repository = new AptRepositoryImpl(codename, component, signer, transport);
 * repository.saveFiles(Collections.singletonList(new DebFile(new File("some.deb"))));
 * }
 * 
* * GpgSigner can be empty. In that case no gpg signature will be generated. * * @author dernasherbrezon * */ public interface AptRepository { /** * Save multiple .deb files into apt repository. The version, architecture and * the package name extracted from the .deb file. * * @param debFiles - list of .deb files. Create .deb file meta information using * DebFile file = new DebFile(new File("some.deb") * @throws IOException - on any error */ void saveFiles(List debFiles) throws IOException; /** * Remove unused files from the repository. * * @param keepLast - keep last number of files in each category * @throws IOException - on any error */ void cleanup(int keepLast) throws IOException; /** * Init empty repository for the architectures provided. * * @param architectures - one or more architectures * @throws IOException - on any error */ void init(Architecture... architectures) throws IOException; /** * Delete packages and update the index. * * @param packages - packages to remove * @throws IOException - on any error */ void deletePackages(Set packages) throws IOException; /** * Delete unused or incorrectly configured architectures * * @param architectures * @throws IOException */ void deleteArchitectures(Architecture... architectures) throws IOException; /** * Create or update GPG signature of the repository * * @throws IOException */ void sign() throws IOException; /** * Validate repository structure. * * @return list of errors if any */ List validate(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy