summaryrefslogtreecommitdiff
path: root/app/src/androidTest/java/de/test/antennapod/util
diff options
context:
space:
mode:
authorMartin Fietz <martin.fietz@gmail.com>2018-01-14 18:04:53 +0100
committerMartin Fietz <martin.fietz@gmail.com>2018-01-14 18:04:54 +0100
commitb86b6caec80ce6d3e10093bfc2e7c540f1085c9c (patch)
treee91d5598d193f3649697101e0900e6d1280d4563 /app/src/androidTest/java/de/test/antennapod/util
parenteaa994786920c0be1e69a57a974f03a754548347 (diff)
downloadAntennaPod-b86b6caec80ce6d3e10093bfc2e7c540f1085c9c.zip
Weaken declaration access
Diffstat (limited to 'app/src/androidTest/java/de/test/antennapod/util')
-rw-r--r--app/src/androidTest/java/de/test/antennapod/util/service/download/NanoHTTPD.java34
-rw-r--r--app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/AtomGenerator.java2
-rw-r--r--app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/GeneratorUtil.java2
3 files changed, 19 insertions, 19 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/util/service/download/NanoHTTPD.java b/app/src/androidTest/java/de/test/antennapod/util/service/download/NanoHTTPD.java
index 4c8fa0e60..0ce9df0aa 100644
--- a/app/src/androidTest/java/de/test/antennapod/util/service/download/NanoHTTPD.java
+++ b/app/src/androidTest/java/de/test/antennapod/util/service/download/NanoHTTPD.java
@@ -88,15 +88,15 @@ public abstract class NanoHTTPD {
* This is required as the Keep-Alive HTTP connections would otherwise
* block the socket reading thread forever (or as long the browser is open).
*/
- public static final int SOCKET_READ_TIMEOUT = 5000;
+ private static final int SOCKET_READ_TIMEOUT = 5000;
/**
* Common mime type for dynamic content: plain text
*/
- public static final String MIME_PLAINTEXT = "text/plain";
+ private static final String MIME_PLAINTEXT = "text/plain";
/**
* Common mime type for dynamic content: html
*/
- public static final String MIME_HTML = "text/html";
+ private static final String MIME_HTML = "text/html";
/**
* Pseudo-Parameter to use to store the actual query string in the parameters map for later re-processing.
*/
@@ -118,14 +118,14 @@ public abstract class NanoHTTPD {
/**
* Constructs an HTTP server on given port.
*/
- public NanoHTTPD(int port) {
+ NanoHTTPD(int port) {
this(null, port);
}
/**
* Constructs an HTTP server on given hostname and port.
*/
- public NanoHTTPD(String hostname, int port) {
+ private NanoHTTPD(String hostname, int port) {
this.hostname = hostname;
this.myPort = port;
setTempFileManagerFactory(new DefaultTempFileManagerFactory());
@@ -226,7 +226,7 @@ public abstract class NanoHTTPD {
*
* @param socket the {@link Socket} for the connection.
*/
- public synchronized void registerConnection(Socket socket) {
+ private synchronized void registerConnection(Socket socket) {
openConnections.add(socket);
}
@@ -236,14 +236,14 @@ public abstract class NanoHTTPD {
* @param socket
* the {@link Socket} for the connection.
*/
- public synchronized void unRegisterConnection(Socket socket) {
+ private synchronized void unRegisterConnection(Socket socket) {
openConnections.remove(socket);
}
/**
* Forcibly closes all connections that are open.
*/
- public synchronized void closeAllConnections() {
+ private synchronized void closeAllConnections() {
for (Socket socket : openConnections) {
safeClose(socket);
}
@@ -253,7 +253,7 @@ public abstract class NanoHTTPD {
return myServerSocket == null ? -1 : myServerSocket.getLocalPort();
}
- public final boolean wasStarted() {
+ private boolean wasStarted() {
return myServerSocket != null && myThread != null;
}
@@ -288,7 +288,7 @@ public abstract class NanoHTTPD {
* @param session The HTTP session
* @return HTTP response, see class Response for details
*/
- public Response serve(IHTTPSession session) {
+ Response serve(IHTTPSession session) {
Map<String, String> files = new ArrayMap<>();
Method method = session.getMethod();
if (Method.PUT.equals(method) || Method.POST.equals(method)) {
@@ -312,7 +312,7 @@ public abstract class NanoHTTPD {
* @param str the percent encoded <code>String</code>
* @return expanded form of the input, for example "foo%20bar" becomes "foo bar"
*/
- protected String decodePercent(String str) {
+ private String decodePercent(String str) {
String decoded = null;
try {
decoded = URLDecoder.decode(str, "UTF8");
@@ -341,7 +341,7 @@ public abstract class NanoHTTPD {
* @param queryString a query string pulled from the URL.
* @return a map of <code>String</code> (parameter name) to <code>List&lt;String&gt;</code> (a list of the values supplied).
*/
- protected Map<String, List<String>> decodeParameters(String queryString) {
+ private Map<String, List<String>> decodeParameters(String queryString) {
Map<String, List<String>> parms = new ArrayMap<>();
if (queryString != null) {
StringTokenizer st = new StringTokenizer(queryString, "&");
@@ -372,7 +372,7 @@ public abstract class NanoHTTPD {
*
* @param asyncRunner new strategy for handling threads.
*/
- public void setAsyncRunner(AsyncRunner asyncRunner) {
+ private void setAsyncRunner(AsyncRunner asyncRunner) {
this.asyncRunner = asyncRunner;
}
@@ -387,7 +387,7 @@ public abstract class NanoHTTPD {
*
* @param tempFileManagerFactory new strategy for handling temp files.
*/
- public void setTempFileManagerFactory(TempFileManagerFactory tempFileManagerFactory) {
+ private void setTempFileManagerFactory(TempFileManagerFactory tempFileManagerFactory) {
this.tempFileManagerFactory = tempFileManagerFactory;
}
@@ -610,7 +610,7 @@ public abstract class NanoHTTPD {
/**
* Sends given response to the socket.
*/
- protected void send(OutputStream outputStream) {
+ void send(OutputStream outputStream) {
String mime = mimeType;
SimpleDateFormat gmtFrmt = new SimpleDateFormat("E, d MMM yyyy HH:mm:ss 'GMT'", Locale.US);
gmtFrmt.setTimeZone(TimeZone.getTimeZone("GMT"));
@@ -655,13 +655,13 @@ public abstract class NanoHTTPD {
}
}
- protected void sendContentLengthHeaderIfNotAlreadyPresent(PrintWriter pw, Map<String, String> header, int size) {
+ void sendContentLengthHeaderIfNotAlreadyPresent(PrintWriter pw, Map<String, String> header, int size) {
if (!headerAlreadySent(header, "content-length")) {
pw.print("Content-Length: "+ size +"\r\n");
}
}
- protected void sendConnectionHeaderIfNotAlreadyPresent(PrintWriter pw, Map<String, String> header) {
+ void sendConnectionHeaderIfNotAlreadyPresent(PrintWriter pw, Map<String, String> header) {
if (!headerAlreadySent(header, "connection")) {
pw.print("Connection: keep-alive\r\n");
}
diff --git a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/AtomGenerator.java b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/AtomGenerator.java
index bd3df0f9d..afe15f1b2 100644
--- a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/AtomGenerator.java
+++ b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/AtomGenerator.java
@@ -19,7 +19,7 @@ public class AtomGenerator implements FeedGenerator{
private static final String NS_ATOM = "http://www.w3.org/2005/Atom";
- public static final long FEATURE_USE_RFC3339LOCAL = 1;
+ private static final long FEATURE_USE_RFC3339LOCAL = 1;
@Override
public void writeFeed(Feed feed, OutputStream outputStream, String encoding, long flags) throws IOException {
diff --git a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/GeneratorUtil.java b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/GeneratorUtil.java
index e7cbb1b42..7f6f0fb0f 100644
--- a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/GeneratorUtil.java
+++ b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/GeneratorUtil.java
@@ -7,7 +7,7 @@ import java.io.IOException;
/**
* Utility methods for FeedGenerator
*/
-public class GeneratorUtil {
+class GeneratorUtil {
public static void addPaymentLink(XmlSerializer xml, String paymentLink, boolean withNamespace) throws IOException {
String ns = (withNamespace) ? "http://www.w3.org/2005/Atom" : null;