mirror of
https://github.com/Rogiel/httpchannel
synced 2025-12-05 23:22:51 +00:00
Modularize in maven projects the httpchannel library
This commit creates several maven modules for each segment of the library. Now it is possible to include only individual services to the classpath instead of the full library.
This commit is contained in:
10
.classpath
10
.classpath
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
|
|
||||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
|
|
||||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
|
|
||||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
|
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
|
||||||
</classpath>
|
|
||||||
15
.gitignore
vendored
15
.gitignore
vendored
@@ -1 +1,14 @@
|
|||||||
/target
|
# Eclipse project files and folders
|
||||||
|
.project
|
||||||
|
.metadata
|
||||||
|
.classpath
|
||||||
|
.settings/
|
||||||
|
|
||||||
|
# Locally stored "Eclipse launch configurations"
|
||||||
|
*.launch
|
||||||
|
|
||||||
|
# Maven target directory
|
||||||
|
target/
|
||||||
|
|
||||||
|
# Find bugs configuration file
|
||||||
|
/.fbprefs
|
||||||
24
.project
24
.project
@@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>seedbox-httpchannel</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
||||||
<nature>org.maven.ide.eclipse.maven2Nature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#Sun Sep 11 18:22:22 BRT 2011
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#Tue Sep 13 15:42:20 BRT 2011
|
|
||||||
activeProfiles=
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
resolveWorkspaceProjects=true
|
|
||||||
version=1
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#Sun Aug 14 13:30:10 BRT 2011
|
|
||||||
activeProfiles=
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
fullBuildGoals=process-test-resources
|
|
||||||
resolveWorkspaceProjects=true
|
|
||||||
resourceFilterGoals=process-resources resources\:testResources
|
|
||||||
skipCompilerPlugin=true
|
|
||||||
version=1
|
|
||||||
10
httpchannel-api/pom.xml
Normal file
10
httpchannel-api/pom.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>httpchannel</artifactId>
|
||||||
|
<groupId>com.rogiel.httpchannel</groupId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<relativePath>..</relativePath>
|
||||||
|
</parent>
|
||||||
|
<artifactId>httpchannel-api</artifactId>
|
||||||
|
</project>
|
||||||
@@ -36,6 +36,7 @@ public class CapabilityMatrix<T> {
|
|||||||
* @param matrix
|
* @param matrix
|
||||||
* all the capabilities this service support
|
* all the capabilities this service support
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public CapabilityMatrix(T... matrix) {
|
public CapabilityMatrix(T... matrix) {
|
||||||
this.matrix = matrix;
|
this.matrix = matrix;
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,8 @@ public interface Downloader {
|
|||||||
*
|
*
|
||||||
* @param listener
|
* @param listener
|
||||||
* the listener to keep a track on the download progress
|
* the listener to keep a track on the download progress
|
||||||
|
* @param position
|
||||||
|
* the download start position. If seek is supported by service.
|
||||||
*
|
*
|
||||||
* @return the {@link DownloadChannel} instance
|
* @return the {@link DownloadChannel} instance
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
@@ -44,6 +46,7 @@ public interface Downloader {
|
|||||||
* if the download limit has been exceed, most times thrown when
|
* if the download limit has been exceed, most times thrown when
|
||||||
* downloading as a non-premium user
|
* downloading as a non-premium user
|
||||||
*/
|
*/
|
||||||
DownloadChannel download(DownloadListener listener) throws IOException,
|
DownloadChannel download(DownloadListener listener, long position)
|
||||||
DownloadLinkNotFoundException, DownloadLimitExceededException;
|
throws IOException, DownloadLinkNotFoundException,
|
||||||
|
DownloadLimitExceededException;
|
||||||
}
|
}
|
||||||
@@ -21,12 +21,10 @@ import java.io.OutputStream;
|
|||||||
import java.nio.channels.Channels;
|
import java.nio.channels.Channels;
|
||||||
import java.nio.channels.WritableByteChannel;
|
import java.nio.channels.WritableByteChannel;
|
||||||
|
|
||||||
|
|
||||||
import org.apache.http.entity.mime.content.AbstractContentBody;
|
import org.apache.http.entity.mime.content.AbstractContentBody;
|
||||||
import org.apache.http.entity.mime.content.ContentBody;
|
import org.apache.http.entity.mime.content.ContentBody;
|
||||||
|
|
||||||
import com.rogiel.httpchannel.service.Uploader;
|
import com.rogiel.httpchannel.service.Uploader;
|
||||||
import com.rogiel.httpchannel.util.ThreadUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link ContentBody} used to upload files in {@link Uploader} implementations.
|
* {@link ContentBody} used to upload files in {@link Uploader} implementations.
|
||||||
@@ -53,7 +51,10 @@ public class LinkedUploadChannelContentBody extends AbstractContentBody {
|
|||||||
channel.linkChannel(outputChannel);
|
channel.linkChannel(outputChannel);
|
||||||
|
|
||||||
while (channel.isOpen() && outputChannel.isOpen()) {
|
while (channel.isOpen() && outputChannel.isOpen()) {
|
||||||
ThreadUtils.sleep(500);
|
try {
|
||||||
|
Thread.sleep(500);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
10
httpchannel-service/httpchannel-service-hotfile/pom.xml
Normal file
10
httpchannel-service/httpchannel-service-hotfile/pom.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>httpchannel-service</artifactId>
|
||||||
|
<groupId>com.rogiel.httpchannel</groupId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<relativePath>..</relativePath>
|
||||||
|
</parent>
|
||||||
|
<artifactId>httpchannel-service-hotfile</artifactId>
|
||||||
|
</project>
|
||||||
@@ -48,8 +48,8 @@ import com.rogiel.httpchannel.service.Uploader;
|
|||||||
import com.rogiel.httpchannel.service.UploaderCapability;
|
import com.rogiel.httpchannel.service.UploaderCapability;
|
||||||
import com.rogiel.httpchannel.service.channel.InputStreamDownloadChannel;
|
import com.rogiel.httpchannel.service.channel.InputStreamDownloadChannel;
|
||||||
import com.rogiel.httpchannel.service.channel.LinkedUploadChannel;
|
import com.rogiel.httpchannel.service.channel.LinkedUploadChannel;
|
||||||
import com.rogiel.httpchannel.service.channel.LinkedUploadChannelContentBody;
|
|
||||||
import com.rogiel.httpchannel.service.channel.LinkedUploadChannel.LinkedUploadChannelCloseCallback;
|
import com.rogiel.httpchannel.service.channel.LinkedUploadChannel.LinkedUploadChannelCloseCallback;
|
||||||
|
import com.rogiel.httpchannel.service.channel.LinkedUploadChannelContentBody;
|
||||||
import com.rogiel.httpchannel.service.config.ServiceConfiguration;
|
import com.rogiel.httpchannel.service.config.ServiceConfiguration;
|
||||||
import com.rogiel.httpchannel.service.exception.AuthenticationInvalidCredentialException;
|
import com.rogiel.httpchannel.service.exception.AuthenticationInvalidCredentialException;
|
||||||
import com.rogiel.httpchannel.service.impl.HotFileService.HotFileServiceConfiguration;
|
import com.rogiel.httpchannel.service.impl.HotFileService.HotFileServiceConfiguration;
|
||||||
@@ -198,7 +198,7 @@ public class HotFileService extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DownloadChannel download(DownloadListener listener)
|
public DownloadChannel download(DownloadListener listener, long position)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
final HTMLPage page = getAsPage(url.toString());
|
final HTMLPage page = getAsPage(url.toString());
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ public class HotFileServiceTest {
|
|||||||
|
|
||||||
final Properties properties = new Properties();
|
final Properties properties = new Properties();
|
||||||
properties.load(new FileInputStream(
|
properties.load(new FileInputStream(
|
||||||
"src/test/resources/config/hotfile.properties"));
|
"src/test/resources/login.properties"));
|
||||||
VALID_USERNAME = properties.getProperty("username");
|
VALID_USERNAME = properties.getProperty("username");
|
||||||
VALID_PASSWORD = properties.getProperty("password");
|
VALID_PASSWORD = properties.getProperty("password");
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@ public class HotFileServiceTest {
|
|||||||
.getDownloader(
|
.getDownloader(
|
||||||
new URL(
|
new URL(
|
||||||
"http://hotfile.com/dl/129251605/9b4faf2/simulado_2010_1_res_all.zip.html"))
|
"http://hotfile.com/dl/129251605/9b4faf2/simulado_2010_1_res_all.zip.html"))
|
||||||
.download(null);
|
.download(null, 0);
|
||||||
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
||||||
IOUtils.copy(Channels.newInputStream(channel), bout);
|
IOUtils.copy(Channels.newInputStream(channel), bout);
|
||||||
System.out.println(bout.size());
|
System.out.println(bout.size());
|
||||||
@@ -177,7 +177,7 @@ public class HotFileServiceTest {
|
|||||||
.getDownloader(
|
.getDownloader(
|
||||||
new URL(
|
new URL(
|
||||||
"http://hotfile.com/dl/129251605/9b4faf2/simulado_2010_1_res_all.zip.html"))
|
"http://hotfile.com/dl/129251605/9b4faf2/simulado_2010_1_res_all.zip.html"))
|
||||||
.download(null);
|
.download(null, 0);
|
||||||
|
|
||||||
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
||||||
IOUtils.copy(Channels.newInputStream(channel), bout);
|
IOUtils.copy(Channels.newInputStream(channel), bout);
|
||||||
1
httpchannel-service/httpchannel-service-hotfile/src/test/resources/.gitignore
vendored
Normal file
1
httpchannel-service/httpchannel-service-hotfile/src/test/resources/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/login.properties
|
||||||
10
httpchannel-service/httpchannel-service-megaupload/pom.xml
Normal file
10
httpchannel-service/httpchannel-service-megaupload/pom.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>httpchannel-service</artifactId>
|
||||||
|
<groupId>com.rogiel.httpchannel</groupId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<relativePath>..</relativePath>
|
||||||
|
</parent>
|
||||||
|
<artifactId>httpchannel-service-megaupload</artifactId>
|
||||||
|
</project>
|
||||||
@@ -222,7 +222,7 @@ public class MegaUploadService extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DownloadChannel download(DownloadListener listener)
|
public DownloadChannel download(DownloadListener listener, long position)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
HttpResponse response = get(url.toString());
|
HttpResponse response = get(url.toString());
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ public class MegaUploadService extends
|
|||||||
final String downloadUrl = page
|
final String downloadUrl = page
|
||||||
.getLink(DOWNLOAD_DIRECT_LINK_PATTERN);
|
.getLink(DOWNLOAD_DIRECT_LINK_PATTERN);
|
||||||
if (downloadUrl != null && downloadUrl.length() > 0) {
|
if (downloadUrl != null && downloadUrl.length() > 0) {
|
||||||
final HttpResponse downloadResponse = get(downloadUrl);
|
final HttpResponse downloadResponse = get(downloadUrl, position);
|
||||||
if (downloadResponse.getStatusLine().getStatusCode() == HttpStatus.SC_FORBIDDEN
|
if (downloadResponse.getStatusLine().getStatusCode() == HttpStatus.SC_FORBIDDEN
|
||||||
|| downloadResponse.getStatusLine().getStatusCode() == HttpStatus.SC_SERVICE_UNAVAILABLE) {
|
|| downloadResponse.getStatusLine().getStatusCode() == HttpStatus.SC_SERVICE_UNAVAILABLE) {
|
||||||
downloadResponse.getEntity().getContent().close();
|
downloadResponse.getEntity().getContent().close();
|
||||||
@@ -83,7 +83,7 @@ public class MegaUploadServiceTest {
|
|||||||
|
|
||||||
final Properties properties = new Properties();
|
final Properties properties = new Properties();
|
||||||
properties.load(new FileInputStream(
|
properties.load(new FileInputStream(
|
||||||
"src/test/resources/config/megaupload.properties"));
|
"src/test/resources/login.properties"));
|
||||||
VALID_USERNAME = properties.getProperty("username");
|
VALID_USERNAME = properties.getProperty("username");
|
||||||
VALID_PASSWORD = properties.getProperty("password");
|
VALID_PASSWORD = properties.getProperty("password");
|
||||||
}
|
}
|
||||||
@@ -166,7 +166,7 @@ public class MegaUploadServiceTest {
|
|||||||
// return true;
|
// return true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
}, 0);
|
||||||
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
||||||
IOUtils.copy(Channels.newInputStream(channel), bout);
|
IOUtils.copy(Channels.newInputStream(channel), bout);
|
||||||
System.out.println(bout.size());
|
System.out.println(bout.size());
|
||||||
@@ -186,7 +186,7 @@ public class MegaUploadServiceTest {
|
|||||||
System.out.println("Waiting " + time);
|
System.out.println("Waiting " + time);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
}, 0);
|
||||||
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
||||||
IOUtils.copy(Channels.newInputStream(channel), bout);
|
IOUtils.copy(Channels.newInputStream(channel), bout);
|
||||||
System.out.println(bout.size());
|
System.out.println(bout.size());
|
||||||
@@ -208,6 +208,6 @@ public class MegaUploadServiceTest {
|
|||||||
System.out.println("Waiting " + time);
|
System.out.println("Waiting " + time);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
1
httpchannel-service/httpchannel-service-megaupload/src/test/resources/.gitignore
vendored
Normal file
1
httpchannel-service/httpchannel-service-megaupload/src/test/resources/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/login.properties
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
This is a simple upload test file.
|
||||||
|
|
||||||
|
This is for testing purposes only.
|
||||||
30
httpchannel-service/pom.xml
Normal file
30
httpchannel-service/pom.xml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>httpchannel</artifactId>
|
||||||
|
<groupId>com.rogiel.httpchannel</groupId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<relativePath>..</relativePath>
|
||||||
|
</parent>
|
||||||
|
<artifactId>httpchannel-service</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
<modules>
|
||||||
|
<module>httpchannel-service-megaupload</module>
|
||||||
|
<module>httpchannel-service-hotfile</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.rogiel.httpchannel</groupId>
|
||||||
|
<artifactId>httpchannel-api</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.rogiel.httpchannel</groupId>
|
||||||
|
<artifactId>httpchannel-util</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
17
httpchannel-util/pom.xml
Normal file
17
httpchannel-util/pom.xml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>httpchannel</artifactId>
|
||||||
|
<groupId>com.rogiel.httpchannel</groupId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<relativePath>..</relativePath>
|
||||||
|
</parent>
|
||||||
|
<artifactId>httpchannel-util</artifactId>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.rogiel.httpchannel</groupId>
|
||||||
|
<artifactId>httpchannel-api</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@@ -72,6 +72,14 @@ public abstract class AbstractHttpService<T extends ServiceConfiguration>
|
|||||||
return client.execute(request);
|
return client.execute(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected HttpResponse get(String url, long rangeStart)
|
||||||
|
throws ClientProtocolException, IOException {
|
||||||
|
final HttpGet request = new HttpGet(url);
|
||||||
|
if (rangeStart >= 0)
|
||||||
|
request.addHeader("Range", "bytes=" + rangeStart + "-");
|
||||||
|
return client.execute(request);
|
||||||
|
}
|
||||||
|
|
||||||
protected String getAsString(String url) throws ClientProtocolException,
|
protected String getAsString(String url) throws ClientProtocolException,
|
||||||
IOException {
|
IOException {
|
||||||
return HttpClientUtils.toString(get(url));
|
return HttpClientUtils.toString(get(url));
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
* This file is part of seedbox <github.com/seedbox>.
|
* This file is part of seedbox <github.com/seedbox>.
|
||||||
*
|
*
|
||||||
* seedbox is free software: you can redistribute it and/or modify
|
* seedbox is free software: you can redistribute it and/or modify
|
||||||
@@ -224,6 +224,9 @@ public class HTMLPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int findIntegerInScript(final Pattern pattern, int n) {
|
public int findIntegerInScript(final Pattern pattern, int n) {
|
||||||
|
String found = findInScript(pattern, n);
|
||||||
|
if(found == null)
|
||||||
|
return 0;
|
||||||
return Integer.parseInt(findInScript(pattern, n));
|
return Integer.parseInt(findInScript(pattern, n));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
log4j.rootLogger=INFO, stdout
|
|
||||||
|
|
||||||
|
|
||||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
|
||||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.stdout.layout.ConversionPattern=%5p [%c] %m%n
|
|
||||||
|
|
||||||
|
|
||||||
log4j.logger.httpclient.wire.header=DEBUG
|
|
||||||
log4j.logger.org.apache.commons.httpclient=DEBUG
|
|
||||||
8
pom.xml
8
pom.xml
@@ -1,8 +1,8 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.rogiel.seedbox</groupId>
|
<groupId>com.rogiel.httpchannel</groupId>
|
||||||
<artifactId>seedbox-httpchannel</artifactId>
|
<artifactId>httpchannel</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<name>Seedbox - HTTP Channel library</name>
|
<name>Seedbox - HTTP Channel library</name>
|
||||||
<description>Library capable of downloading and uploading files from free servers using channels.</description>
|
<description>Library capable of downloading and uploading files from free servers using channels.</description>
|
||||||
@@ -78,5 +78,9 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<modules>
|
<modules>
|
||||||
|
<module>httpchannel-api</module>
|
||||||
|
<module>httpchannel-service</module>
|
||||||
|
<module>httpchannel-util</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
<packaging>pom</packaging>
|
||||||
</project>
|
</project>
|
||||||
1
src/test/resources/.gitignore
vendored
1
src/test/resources/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
/config
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
log4j.rootLogger=INFO, stdout
|
|
||||||
|
|
||||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
|
||||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.stdout.layout.ConversionPattern=%5p [%c] %m%n
|
|
||||||
|
|
||||||
log4j.logger.org.apache.http.impl.conn=DEBUG
|
|
||||||
log4j.logger.org.apache.http.impl.client=DEBUG
|
|
||||||
log4j.logger.org.apache.http.client=DEBUG
|
|
||||||
Reference in New Issue
Block a user