Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package io.packagecloud.client;
  
  import java.util.Map;
The type Package.
 
 public class Package {
     private static Logger logger = LoggerProvider.getLogger();
     private static String[] supportedExtensions = {"deb""dsc""gem""rpm"};
 
     private final SecureRandom random = new SecureRandom();
     private final InputStream filestream;
     private final String repository;
     private final Integer distroVersionId;
 
     private String filename;
     private Map<StringInputStreamsourceFiles;

    
Instantiates a new Package.

Parameters:
filestream the filestream
repository the repository
 
     public Package(
             InputStream filestream,
             String repository) {
         this(filestreamrepositorynullnull);
     }

    
Instantiates a new Package.

Parameters:
filestream the filestream
repository the repository
distroVersionId the distro version id
 
     public Package(
             InputStream filestream,
             String repository,
             Integer distroVersionId) {
         this(filestreamrepositorydistroVersionIdnull);
     }

    
Instantiates a new Package.

Parameters:
bytes the bytes
repository the repository
distroVersionId the distro version id
 
     public Package(
             byte[] bytes,
             String repository,
             Integer distroVersionId) {
         this(new ByteArrayInputStream(bytes), repositorydistroVersionIdnull);
     }

    
Instantiates a new Package.

Parameters:
bytes the bytes
repository the repository
 
     public Package(
             byte[] bytes,
             String repository) {
         this(new ByteArrayInputStream(bytes), repositorynullnull);
     }

    
Instantiates a new Package.

Parameters:
bytes the bytes
repository the repository
distroVersionId the distro version id
sourceFiles the source files
 
     public Package(
             byte[] bytes,
             String repository,
             Integer distroVersionId,
             Map<StringInputStreamsourceFiles) {
         this(new ByteArrayInputStream(bytes), repositorydistroVersionIdsourceFiles);
     }

    
Instantiates a new Package.

Parameters:
filestream the filestream
repository the repository
distroVersionId the distro version id
sourceFiles the source files
    public Package(
            InputStream filestream,
            String repository,
            Integer distroVersionId,
            Map<StringInputStreamsourceFiles) {
        .fine(String.format("new Package(%s, %s, %s, %s"filestreamrepositorydistroVersionIdsourceFiles));
        if (filestream == null) {
            throw new IllegalArgumentException("filestream missing");
        }
        if (repository == null) {
            throw new IllegalArgumentException("repository missing");
        }
        this. = filestream;
        this. = generateFilename();
        this. = repository;
        this. = distroVersionId;
        this. = sourceFiles;
    }

    
Get supported extensions.

Returns:
the string [ ]
    public static String[] getSupportedExtensions() {
        return ;
    }

    
Gets repository.

Returns:
the repository
    public String getRepository() {
        return ;
    }

    
Gets distro version id.

Returns:
the distro version id
    public Integer getDistroVersionId() {
        return ;
    }

    
Gets filestream.

Returns:
the filestream
    public InputStream getFilestream() {
        return ;
    }

    
Gets filename.

Returns:
the filename
    public String getFilename() {
        return ;
    }

    
Sets filename.

Parameters:
filename the filename
    public void setFilename(String filename) {
        this. = filename;
    }

    
Gets source files.

Returns:
the source files
    public Map<StringInputStreamgetSourceFiles() {
        return ;
    }

    
Sets source files.

Parameters:
sourceFiles the source files
    public void setSourceFiles(Map<StringInputStreamsourceFiles) {
        this. = sourceFiles;
    }

    
Generate filename.

Returns:
the string
    public String generateFilename() {
        return new BigInteger(130, ).toString(32);
    }
New to GrepCode? Check out our FAQ X