diff --git a/httpchannel-service/httpchannel-service-archetype/pom.xml b/httpchannel-service/httpchannel-service-archetype/pom.xml deleted file mode 100644 index 4223202..0000000 --- a/httpchannel-service/httpchannel-service-archetype/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - 4.0.0 - - httpchannel-service - com.rogiel.httpchannel - 1.0.1-SNAPSHOT - .. - - httpchannel-service-archetype - maven-archetype - - HttpChannel/Service/Archetype - Provides an maven archetype for service creation - - - - - org.apache.maven.archetype - archetype-packaging - 2.2 - - - - - - - maven-archetype-plugin - 2.2 - - - - - diff --git a/httpchannel-service/httpchannel-service-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/httpchannel-service/httpchannel-service-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml deleted file mode 100644 index 9a48c8c..0000000 --- a/httpchannel-service/httpchannel-service-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - src/main/java - - **/*.java - - - - src/main/resources - - **/*.Service - - - - diff --git a/httpchannel-service/httpchannel-service-archetype/src/main/resources/archetype-resources/pom.xml b/httpchannel-service/httpchannel-service-archetype/src/main/resources/archetype-resources/pom.xml deleted file mode 100644 index d8fd44f..0000000 --- a/httpchannel-service/httpchannel-service-archetype/src/main/resources/archetype-resources/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - 4.0.0 - - httpchannel-service - com.rogiel.httpchannel - 1.0.1-SNAPSHOT - .. - - ${artifactId} - ${groupId} - HttpChannel/Service/${serviceName} - Provides download and upload access for ${serviceName} - ${version} - diff --git a/httpchannel-service/httpchannel-service-archetype/src/main/resources/archetype-resources/src/main/java/${serviceName}Service.java b/httpchannel-service/httpchannel-service-archetype/src/main/resources/archetype-resources/src/main/java/${serviceName}Service.java deleted file mode 100644 index c29ceaa..0000000 --- a/httpchannel-service/httpchannel-service-archetype/src/main/resources/archetype-resources/src/main/java/${serviceName}Service.java +++ /dev/null @@ -1,154 +0,0 @@ -#set( $symbol_pound = '#' ) -#set( $symbol_dollar = '$' ) -#set( $symbol_escape = '\' ) -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package ${package}; - -import java.io.IOException; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; - -import com.rogiel.httpchannel.service.AbstractHttpService; -import com.rogiel.httpchannel.service.AbstractUploader; -import com.rogiel.httpchannel.service.CapabilityMatrix; -import com.rogiel.httpchannel.service.Service; -import com.rogiel.httpchannel.service.ServiceID; -import com.rogiel.httpchannel.service.ServiceMode; -import com.rogiel.httpchannel.service.UploadChannel; -import com.rogiel.httpchannel.service.UploadService; -import com.rogiel.httpchannel.service.Uploader; -import com.rogiel.httpchannel.service.UploaderCapability; -import com.rogiel.httpchannel.service.channel.LinkedUploadChannel; -import com.rogiel.httpchannel.service.channel.LinkedUploadChannel.LinkedUploadChannelCloseCallback; -import com.rogiel.httpchannel.service.config.NullUploaderConfiguration; -import com.rogiel.httpchannel.util.htmlparser.HTMLPage; - -/** - * This service handles uploads to ${serviceName}. - * - * @author Rogiel - * @since 1.0 - */ -public class ${serviceName}Service extends AbstractHttpService implements - Service, UploadService { - /** - * This service ID - */ - public static final ServiceID SERVICE_ID = ServiceID.create("${serviceID}"); - - @Override - public ServiceID getServiceID() { - return SERVICE_ID; - } - - @Override - public int getMajorVersion() { - return 1; - } - - @Override - public int getMinorVersion() { - return 0; - } - - @Override - public CapabilityMatrix getPossibleServiceModes() { - return new CapabilityMatrix(ServiceMode.UNAUTHENTICATED); - } - - @Override - public Uploader getUploader(String filename, - long filesize, NullUploaderConfiguration configuration) { - return new UploaderImpl(filename, filesize, configuration); - } - - @Override - public Uploader getUploader(String filename, - long filesize) { - return getUploader(filename, filesize, newUploaderConfiguration()); - } - - @Override - public NullUploaderConfiguration newUploaderConfiguration() { - // no configuration - return NullUploaderConfiguration.SHARED_INSTANCE; - } - - @Override - public long getMaximumFilesize() { - // no filesize limit - return -1; - } - - @Override - public String[] getSupportedExtensions() { - // no extension restriction - return null; - } - - @Override - public CapabilityMatrix getUploadCapabilities() { - return new CapabilityMatrix( - UploaderCapability.UNAUTHENTICATED_UPLOAD); - } - - protected class UploaderImpl extends - AbstractUploader implements - Uploader, - LinkedUploadChannelCloseCallback { - private Future uploadFuture; - - public UploaderImpl(String filename, long filesize, - NullUploaderConfiguration configuration) { - super(MyServiceService.this, filename, filesize, configuration); - } - - @Override - public UploadChannel openChannel() throws IOException { - logger.debug("Starting upload to ${serviceName}"); - final HTMLPage page = get("http://www.example.com/").asPage(); - - // locate upload uri - String uri = null; - - logger.debug("Upload URI: {}", uri); - - // create a new channel - final LinkedUploadChannel channel = createLinkedChannel(this); - uploadFuture = multipartPost(uri).parameter("[file-parameter]", channel).asPageAsync(); - - // wait for channel link - return waitChannelLink(channel); - } - - @Override - public String finish() throws IOException { - try { - final HTMLPage page = uploadFuture.get(); - // find link - return null; - } catch (InterruptedException e) { - return null; - } catch (ExecutionException e) { - throw (IOException) e.getCause(); - } - } - } -} diff --git a/httpchannel-service/httpchannel-service-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/services/com.rogiel.httpchannel.service.Service b/httpchannel-service/httpchannel-service-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/services/com.rogiel.httpchannel.service.Service deleted file mode 100644 index 5dde9b7..0000000 --- a/httpchannel-service/httpchannel-service-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/services/com.rogiel.httpchannel.service.Service +++ /dev/null @@ -1 +0,0 @@ -${package}.${serviceName}Service \ No newline at end of file diff --git a/httpchannel-service/httpchannel-service-archetype/src/test/resources/projects/basic/archetype.properties b/httpchannel-service/httpchannel-service-archetype/src/test/resources/projects/basic/archetype.properties deleted file mode 100644 index 91c1d1a..0000000 --- a/httpchannel-service/httpchannel-service-archetype/src/test/resources/projects/basic/archetype.properties +++ /dev/null @@ -1,7 +0,0 @@ -#Wed Jan 18 19:02:46 BRST 2012 -package=it.pkg -version=0.1-SNAPSHOT -groupId=archetype.it -artifactId=basic -serviceName = TestService -serviceID = testservice \ No newline at end of file diff --git a/httpchannel-service/httpchannel-service-archetype/src/test/resources/projects/basic/goal.txt b/httpchannel-service/httpchannel-service-archetype/src/test/resources/projects/basic/goal.txt deleted file mode 100644 index e69de29..0000000 diff --git a/httpchannel-service/httpchannel-service-hotfile/src/test/java/com/rogiel/httpchannel/service/impl/HotFileServiceTest.java b/httpchannel-service/httpchannel-service-hotfile/src/test/java/com/rogiel/httpchannel/service/impl/HotFileServiceTest.java index d6494cd..d427043 100644 --- a/httpchannel-service/httpchannel-service-hotfile/src/test/java/com/rogiel/httpchannel/service/impl/HotFileServiceTest.java +++ b/httpchannel-service/httpchannel-service-hotfile/src/test/java/com/rogiel/httpchannel/service/impl/HotFileServiceTest.java @@ -76,9 +76,9 @@ public class HotFileServiceTest { final Properties properties = new Properties(); properties.load(new FileInputStream( - "src/test/resources/login.properties")); - VALID_USERNAME = properties.getProperty("username"); - VALID_PASSWORD = properties.getProperty("password"); + "../src/test/resources/login.properties")); + VALID_USERNAME = properties.getProperty("hotfile.username"); + VALID_PASSWORD = properties.getProperty("hotfile.password"); } @Test diff --git a/httpchannel-service/httpchannel-service-multiupload/pom.xml b/httpchannel-service/httpchannel-service-multiupload/pom.xml index 74750c4..1c7e06b 100644 --- a/httpchannel-service/httpchannel-service-multiupload/pom.xml +++ b/httpchannel-service/httpchannel-service-multiupload/pom.xml @@ -9,5 +9,5 @@ httpchannel-service-multiupload com.rogiel.httpchannel.services HttpChannel/Service/MultiUpload - Provides upload access to multiupload.com + Provides upload access to multiupload.nl \ No newline at end of file diff --git a/httpchannel-service/httpchannel-service-multiupload/src/main/java/com/rogiel/httpchannel/service/multiupload/MultiUploadService.java b/httpchannel-service/httpchannel-service-multiupload/src/main/java/com/rogiel/httpchannel/service/multiupload/MultiUploadService.java index ca3372d..943e46e 100644 --- a/httpchannel-service/httpchannel-service-multiupload/src/main/java/com/rogiel/httpchannel/service/multiupload/MultiUploadService.java +++ b/httpchannel-service/httpchannel-service-multiupload/src/main/java/com/rogiel/httpchannel/service/multiupload/MultiUploadService.java @@ -64,9 +64,9 @@ import com.rogiel.httpchannel.util.htmlparser.HTMLPage; /** - * This service handles uploads to MultiUpload.com. + * This service handles uploads to MultiUpload.nl. * - * @author Rogiel + * @author Rogiel * @since 1.0 */ public class MultiUploadService extends AbstractHttpService implements Service, @@ -78,15 +78,15 @@ public class MultiUploadService extends AbstractHttpService implements Service, */ public static final ServiceID SERVICE_ID = ServiceID.create("multiupload"); - // http://www52.multiupload.com/upload/?UPLOAD_IDENTIFIER=73132658610746 + // http://www52.multiupload.nl/upload/?UPLOAD_IDENTIFIER=73132658610746 private static final Pattern UPLOAD_URI_PATTERN = Pattern - .compile("http://www([0-9]*)\\.multiupload\\.com/upload/\\?UPLOAD_IDENTIFIER=[0-9]*"); + .compile("http://www([0-9]*)\\.multiupload\\.nl/upload/\\?UPLOAD_IDENTIFIER=[0-9]*"); private static final Pattern DOWNLOAD_ID_PATTERN = Pattern .compile("\"downloadid\":\"([0-9a-zA-Z]*)\""); private static final Pattern DOWNLOAD_LINK_PATTERN = Pattern - .compile("http://(www\\.)?multiupload\\.com/([0-9a-zA-Z]*)"); + .compile("http://(www\\.)?multiupload\\.nl/([0-9a-zA-Z]*)"); private static final Pattern DIRECT_DOWNLOAD_LINK_PATTERN = Pattern - .compile("http://www[0-9]*\\.multiupload\\.com(:[0-9]*)?/files/([0-9a-zA-Z]*)/(.*)"); + .compile("http://www[0-9]*\\.multiupload\\.nl(:[0-9]*)?/files/([0-9a-zA-Z]*)/(.*)"); @Override public ServiceID getServiceID() { @@ -217,8 +217,8 @@ public class MultiUploadService extends AbstractHttpService implements Service, @Override public UploadChannel openChannel() throws IOException { - logger.debug("Starting upload to multiupload.com"); - final String uri = get("http://www.multiupload.com/").asPage() + logger.debug("Starting upload to multiupload.nl"); + final String uri = get("http://www.multiupload.nl/").asPage() .findFormAction(UPLOAD_URI_PATTERN); logger.debug("Upload URI is {}", uri); final LinkedUploadChannel channel = createLinkedChannel(this); @@ -247,10 +247,10 @@ public class MultiUploadService extends AbstractHttpService implements Service, try { final String linkId = PatternUtils.find(DOWNLOAD_ID_PATTERN, uploadFuture.get(), 1); - logger.debug("Upload to multiupload.com finished"); + logger.debug("Upload to multiupload.nl finished"); if (linkId == null) return null; - return new StringBuilder("http://www.multiupload.com/").append( + return new StringBuilder("http://www.multiupload.nl/").append( linkId).toString(); } catch (InterruptedException e) { return null; @@ -292,7 +292,7 @@ public class MultiUploadService extends AbstractHttpService implements Service, @Override public AccountDetails login() throws IOException { - final HTMLPage page = post("http://www.multiupload.com/login") + final HTMLPage page = post("http://www.multiupload.nl/login") .parameter("username", credential.getUsername()) .parameter("password", credential.getPassword()).asPage(); @@ -303,7 +303,7 @@ public class MultiUploadService extends AbstractHttpService implements Service, @Override public void logout() throws IOException { - post("http://www.multiupload.com/login").parameter("do", "logout") + post("http://www.multiupload.nl/login").parameter("do", "logout") .request(); // TODO check logout status } diff --git a/httpchannel-service/httpchannel-service-multiupload/src/main/java/com/rogiel/httpchannel/service/multiupload/MultiUploadUploaderConfiguration.java b/httpchannel-service/httpchannel-service-multiupload/src/main/java/com/rogiel/httpchannel/service/multiupload/MultiUploadUploaderConfiguration.java index da1f3d6..8d23d02 100644 --- a/httpchannel-service/httpchannel-service-multiupload/src/main/java/com/rogiel/httpchannel/service/multiupload/MultiUploadUploaderConfiguration.java +++ b/httpchannel-service/httpchannel-service-multiupload/src/main/java/com/rogiel/httpchannel/service/multiupload/MultiUploadUploaderConfiguration.java @@ -54,8 +54,9 @@ public class MultiUploadUploaderConfiguration extends * @author Rogiel */ public enum MultiUploadMirrorService { - MEGAUPLOAD(1), UPLOADKING(16), DEPOSIT_FILES(7), HOTFILE(9), UPLOAD_HERE( - 17), ZSHARE(6), FILE_SONIC(15), FILE_SERVE(18), WUPLOAD(19); + MEGAUPLOAD(1), UPLOADKING(16), DEPOSIT_FILES(7), HOTFILE(9), TWO_SHARED( + 11), UPLOAD_HERE(17), ZSHARE(6), FILE_SONIC(15), FILE_SERVE(18), PUT_LOCKER( + 19), ORON(20), FILE_FACTORY(21), FREAK_SHARED(23); /** * The internal multiupload id diff --git a/httpchannel-service/httpchannel-service-multiupload/src/test/java/com/rogiel/httpchannel/service/impl/MultiUploadServiceTest.java b/httpchannel-service/httpchannel-service-multiupload/src/test/java/com/rogiel/httpchannel/service/impl/MultiUploadServiceTest.java index dcf0974..53c189c 100644 --- a/httpchannel-service/httpchannel-service-multiupload/src/test/java/com/rogiel/httpchannel/service/impl/MultiUploadServiceTest.java +++ b/httpchannel-service/httpchannel-service-multiupload/src/test/java/com/rogiel/httpchannel/service/impl/MultiUploadServiceTest.java @@ -61,7 +61,7 @@ public class MultiUploadServiceTest { public void testDownloader() throws IOException, NoSuchAlgorithmException { final byte[] data = ChannelUtils .toByteArray(((DownloadService) service).getDownloader( - URI.create("http://www.multiupload.com/TJOYWB4JEW")) + URI.create("http://www.multiupload.nl/ITPPI2YSYX")) .openChannel()); assertChecksum("Downloaded data checksum did not matched", "SHA1", data, EXPECTED_FULL_CHECKSUM); @@ -72,7 +72,7 @@ public class MultiUploadServiceTest { NoSuchAlgorithmException { final byte[] data = ChannelUtils .toByteArray(((DownloadService) service).getDownloader( - URI.create("http://www.multiupload.com/TJOYWB4JEW")) + URI.create("http://www.multiupload.nl/ITPPI2YSYX")) .openChannel(50)); assertChecksum("Downloaded data checksum did not matched", "SHA1", data, EXPECTED_RESUME_CHECKSUM); diff --git a/httpchannel-service/pom.xml b/httpchannel-service/pom.xml index 2efec5f..a8467de 100644 --- a/httpchannel-service/pom.xml +++ b/httpchannel-service/pom.xml @@ -14,8 +14,6 @@ Parent module that all service implementations should inherit - httpchannel-service-archetype - httpchannel-service-megaupload httpchannel-service-multiupload httpchannel-service-uploadking httpchannel-service-uploadhere