1
0
mirror of https://github.com/Rogiel/httpchannel synced 2025-12-06 07:32:50 +00:00

Adds -SNAPSHOT to Maven version parameter and few modifications to API

This commit is contained in:
2012-01-17 17:07:48 -02:00
parent 08d22a12fe
commit 673bfc6639
56 changed files with 536 additions and 399 deletions

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>httpchannel-service</artifactId>
<groupId>com.rogiel.httpchannel</groupId>
<version>1.0.0</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>httpchannel-service-zshare</artifactId>

View File

@@ -30,22 +30,22 @@ public class ZShareService extends AbstractHttpService implements Service/*
*/
public static final ServiceID SERVICE_ID = ServiceID.create("zshare");
// private static final Pattern UPLOAD_URL_PATTERN = Pattern
// private static final Pattern UPLOAD_URI_PATTERN = Pattern
// .compile("http://dl([0-9]*)\\.zshare\\.net(\\:[0-9]*)?/",
// Pattern.CASE_INSENSITIVE);
// private static final Pattern DOWNLOAD_ID_PATTERN = Pattern
// .compile("\"downloadid\":\"([0-9a-zA-Z]*)\"");
// private static final Pattern DOWNLOAD_URL_PATTERN = Pattern
// private static final Pattern DOWNLOAD_URI_PATTERN = Pattern
// .compile("http://(www\\.)?uploadking.\\com/[0-9A-z]*");
// private static final Pattern TIMER_PATTERN = Pattern.compile(
// "count = ([0-9]*);", Pattern.COMMENTS);
// private static final Pattern DIERCT_DOWNLOAD_URL_PATTERN = Pattern
// private static final Pattern DIERCT_DOWNLOAD_URI_PATTERN = Pattern
// .compile("(http:\\\\/\\\\/www[0-9]*\\.uploadking\\.com(:[0-9]*)?\\\\/files\\\\/([0-9A-z]*)\\\\/(.*))\"");
//
// private static final String INVALID_LOGIN_STRING = "Incorrect username and/or password. Please try again!";
@Override
public ServiceID getID() {
public ServiceID getServiceID() {
return SERVICE_ID;
}
@@ -95,14 +95,14 @@ public class ZShareService extends AbstractHttpService implements Service/*
// }
// @Override
// public Downloader<NullDownloaderConfiguration> getDownloader(URL url,
// public Downloader<NullDownloaderConfiguration> getDownloader(URI uri,
// NullDownloaderConfiguration configuration) {
// return new DownloaderImpl(url, configuration);
// return new DownloaderImpl(uri, configuration);
// }
//
// @Override
// public Downloader<NullDownloaderConfiguration> getDownloader(URL url) {
// return getDownloader(url, newDownloaderConfiguration());
// public Downloader<NullDownloaderConfiguration> getDownloader(URI uri) {
// return getDownloader(uri, newDownloaderConfiguration());
// }
//
// @Override
@@ -111,8 +111,8 @@ public class ZShareService extends AbstractHttpService implements Service/*
// }
//
// @Override
// public boolean matchURL(URL url) {
// return DOWNLOAD_URL_PATTERN.matcher(url.toString()).matches();
// public boolean matchURI(URI uri) {
// return DOWNLOAD_URI_PATTERN.matcher(uri.toString()).matches();
// }
//
// @Override
@@ -162,12 +162,12 @@ public class ZShareService extends AbstractHttpService implements Service/*
// public UploadChannel openChannel() throws IOException {
// final HTMLPage page = get("http://www.zshare.net/").asPage();
//
// final String url = page.findFormAction(UPLOAD_URL_PATTERN);
// System.out.println(url+"cgi-bin/ubr_upload.pl");
// final String uri = page.findFormAction(UPLOAD_URI_PATTERN);
// System.out.println(uri+"cgi-bin/ubr_upload.pl");
//
// final LinkedUploadChannel channel = createLinkedChannel(this);
// uploadFuture =
// multipartPost(url+"cgi-bin/ubr_upload.pl").parameter("file", channel)
// multipartPost(uri+"cgi-bin/ubr_upload.pl").parameter("file", channel)
// .parameter("descr", configuration.description())
// .parameter("TOS", true).parameter("is_private", false)
// .asStringAsync();
@@ -196,15 +196,15 @@ public class ZShareService extends AbstractHttpService implements Service/*
// protected class DownloaderImpl extends
// AbstractHttpDownloader<NullDownloaderConfiguration> implements
// Downloader<NullDownloaderConfiguration> {
// public DownloaderImpl(URL url, NullDownloaderConfiguration configuration)
// public DownloaderImpl(URI uri, NullDownloaderConfiguration configuration)
// {
// super(url, configuration);
// super(uri, configuration);
// }
//
// @Override
// public DownloadChannel openChannel(DownloadListener listener,
// long position) throws IOException {
// HTMLPage page = get(url).asPage();
// HTMLPage page = get(uri).asPage();
//
// final int waitTime = page.findScriptAsInt(TIMER_PATTERN, 1) * 1000;
//
@@ -218,12 +218,12 @@ public class ZShareService extends AbstractHttpService implements Service/*
// // if (delta < waitTime)
// // timer(listener, waitTime - delta);
// //
// // String content = post(url)
// // String content = post(uri)
// // .parameter("recaptcha_challenge_field", captcha.getID())
// // .parameter("recaptcha_response_field",
// // captcha.getAnswer()).asString();
// // String downloadLink = PatternUtils.find(
// // DIERCT_DOWNLOAD_URL_PATTERN, content, 1);
// // DIERCT_DOWNLOAD_URI_PATTERN, content, 1);
// // if (downloadLink == null)
// // throw new InvalidCaptchaException();
// // downloadLink = downloadLink.replaceAll(Pattern.quote("\\/"),