Search in sources :

Example 1 with Paragraph

use of org.sonatype.nexus.repository.apt.internal.debian.ControlFile.Paragraph in project nexus-public by sonatype.

the class OrientAptHostedFacet method buildReleaseFile.

private String buildReleaseFile(final String distribution, final Collection<String> architectures, final String md5, final String sha256) {
    String date = DateFormatUtils.format(new Date(), PATTERN_RFC1123, TimeZone.getTimeZone("GMT"));
    Paragraph p = new Paragraph(Arrays.asList(new ControlFile.ControlField("Suite", distribution), new ControlFile.ControlField("Codename", distribution), new ControlFile.ControlField("Components", "main"), new ControlFile.ControlField("Date", date), new ControlFile.ControlField("Architectures", String.join(" ", architectures)), new ControlFile.ControlField("SHA256", sha256), new ControlFile.ControlField("MD5Sum", md5)));
    return p.toString();
}
Also used : Date(java.util.Date) Paragraph(org.sonatype.nexus.repository.apt.internal.debian.ControlFile.Paragraph)

Example 2 with Paragraph

use of org.sonatype.nexus.repository.apt.internal.debian.ControlFile.Paragraph in project nexus-public by sonatype.

the class AptHostedFacet method buildReleaseFile.

private String buildReleaseFile(final String distribution, final Collection<String> architectures, final String md5, final String sha256) {
    String date = DateFormatUtils.format(new Date(), PATTERN_RFC1123, TimeZone.getTimeZone("GMT"));
    Paragraph p = new Paragraph(Arrays.asList(new ControlFile.ControlField("Suite", distribution), new ControlFile.ControlField("Codename", distribution), new ControlFile.ControlField("Components", "main"), new ControlFile.ControlField("Date", date), new ControlFile.ControlField("Architectures", String.join(StringUtils.SPACE, architectures)), new ControlFile.ControlField("SHA256", sha256), new ControlFile.ControlField("MD5Sum", md5)));
    return p.toString();
}
Also used : Date(java.util.Date) Paragraph(org.sonatype.nexus.repository.apt.internal.debian.ControlFile.Paragraph)

Example 3 with Paragraph

use of org.sonatype.nexus.repository.apt.internal.debian.ControlFile.Paragraph in project nexus-public by sonatype.

the class ControlFileParser method finishParagraph.

private void finishParagraph() {
    if (fields.isEmpty()) {
        return;
    }
    paragraphs.add(new Paragraph(fields));
    fields.clear();
}
Also used : Paragraph(org.sonatype.nexus.repository.apt.internal.debian.ControlFile.Paragraph)

Aggregations

Paragraph (org.sonatype.nexus.repository.apt.internal.debian.ControlFile.Paragraph)3 Date (java.util.Date)2