Skip to content

Commit

Permalink
Remove deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dwalluck committed Apr 3, 2024
1 parent 1c2bfee commit 8685f8c
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 39 deletions.
6 changes: 0 additions & 6 deletions deb/src/main/java/org/eclipse/packager/deb/Packages.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
package org.eclipse.packager.deb;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
Expand All @@ -37,11 +36,6 @@ public final class Packages {
private Packages() {
}

@Deprecated
public static Map<String, String> parseControlFile(final File packageFile) throws IOException, ParserException {
return parseControlFile(packageFile.toPath());
}

public static Map<String, String> parseControlFile(final Path packageFile) throws IOException, ParserException {
try (final ArArchiveInputStream in = new ArArchiveInputStream(Files.newInputStream(packageFile))) {
ArchiveEntry ar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
package org.eclipse.packager.deb.build;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
Expand Down Expand Up @@ -101,11 +100,6 @@ public DebianPackageWriter(final OutputStream stream, final BinaryPackageControl
this.dataStream.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);
}

@Deprecated
public void addFile(final File file, final String fileName, final EntryInformation entryInformation) throws IOException {
addFile(file.toPath(), fileName, entryInformation);
}

public void addFile(final Path file, final String fileName, final EntryInformation entryInformation) throws IOException {
addFile(new FileContentProvider(file), fileName, entryInformation, Optional.of(() -> {
if (file == null || !Files.isReadable(file)) {
Expand All @@ -120,11 +114,6 @@ public void addFile(final Path file, final String fileName, final EntryInformati
}));
}

@Deprecated
public void addFile(final File file, final String fileName, final EntryInformation entryInformation, final Optional<Supplier<Instant>> timestampSupplier) throws IOException {
addFile(file.toPath(), fileName, entryInformation, timestampSupplier);
}

public void addFile(final Path file, final String fileName, final EntryInformation entryInformation, final Optional<Supplier<Instant>> timestampSupplier) throws IOException {
addFile(new FileContentProvider(file), fileName, entryInformation, timestampSupplier);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,14 @@
*/
package org.eclipse.packager.deb.build;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;

public class FileContentProvider implements ContentProvider {

private final Path file;

@Deprecated
public FileContentProvider(final File file) {
this(file.toPath());
}

public FileContentProvider(final Path file) {
this.file = file;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
package org.eclipse.packager.deb.build;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
Expand All @@ -23,11 +22,6 @@
public class TextFileContentProvider implements ContentProvider {
private final byte[] data;

@Deprecated
public TextFileContentProvider(final File file) throws IOException {
this(file.toPath());
}

public TextFileContentProvider(final Path file) throws IOException {
if (file != null) {
String data = Files.readString(file);
Expand All @@ -54,7 +48,7 @@ public long getSize() {
}

@Override
public InputStream createInputStream() throws IOException {
public InputStream createInputStream() {
if (this.data != null) {
return new ByteArrayInputStream(this.data);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
package org.eclipse.packager.rpm.signature;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
Expand Down Expand Up @@ -47,17 +46,10 @@
* {@link #perform(Path, InputStream, String, OutputStream, HashAlgorithm)}
*/
public class RpmFileSignatureProcessor {

private RpmFileSignatureProcessor() {
// Hide default constructor because of the static context
}

@Deprecated
public static void perform(File rpm, InputStream privateKeyIn, String passphrase, OutputStream out, HashAlgorithm hashAlgorithm)
throws IOException, PGPException {
perform(rpm.toPath(), privateKeyIn, passphrase, out, hashAlgorithm);
}

/**
* <p>
* Perform the signature of the given RPM file with the given private key. This
Expand Down

0 comments on commit 8685f8c

Please sign in to comment.