mirror of
https://github.com/Rogiel/httpchannel
synced 2025-12-06 07:32:50 +00:00
Compare commits
24 Commits
httpchanne
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 00133750eb | |||
| 0386906356 | |||
| 4a9da1708e | |||
| d838636f2a | |||
| 55cb79d599 | |||
| 1c8cc0e893 | |||
| 000db710cd | |||
| 4c2a7a5810 | |||
| d2a0e4baa4 | |||
| cd075252a5 | |||
| 4ffd291570 | |||
| 4efdcd2e18 | |||
| bcb9f6dbca | |||
| cd835e2064 | |||
| 3b06f0b9e6 | |||
| 885de35de5 | |||
| f190e8096d | |||
| 7f558b31c5 | |||
| 6f608029b3 | |||
| 95b549da2c | |||
| cd2b479b5b | |||
| 179570680d | |||
| 0a908a7756 | |||
| 1a3b8c95b6 |
4
.travis.yml
Normal file
4
.travis.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
language: java
|
||||
jdk:
|
||||
- openjdk7
|
||||
- oraclejdk7
|
||||
16
README
16
README
@@ -1,16 +0,0 @@
|
||||
== What is this? ==
|
||||
|
||||
This is a Java Library written to simplify download and upload from multiple
|
||||
free share sites.
|
||||
|
||||
Instead of writing an specific API for each situation, I designed a single API
|
||||
capable of almost everything! Upload and downloads are done through Java.NIO
|
||||
Channels and with those you can stream the file, both up and down.
|
||||
|
||||
Also, if you wish, you can easily (with less than 10 lines!) implement an
|
||||
file copier. It downloads the file from one server and transfer it to another!
|
||||
|
||||
== Can I use it already? ==
|
||||
The API is basically done, but so far not much servers are supported, but you
|
||||
are, however, free to use it already! By the way, once you start using it, if
|
||||
you develop any new service, please share with me!
|
||||
11
README.md
Normal file
11
README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
The HttpChannel library is a library that povides downloading and uploading capabilities to several share-sites (such as MegaUpload and FileSonic).
|
||||
Obviously, the API supports a lot more services, but those are the most commonly used. Aside from that, the biggest point of the library is its simple usage, you don't need to use any customized API to perform download or uploads, you simply use the standard Java NIO Channels for both upload and download.
|
||||
|
||||
final UploadService<?> service = Services.getUploadService("megaupload");
|
||||
final Uploader<?> uploader = UploadServices.upload(service, Path.get("test-file.txt"));
|
||||
final UploadChannel channel = uploader.openChannel();
|
||||
// now, you can perform any operation you want with this channel! Lets copy its data
|
||||
ChannelUtils.copy(inputChannel, channel);
|
||||
// this may take some time, it will finish the upload and generate the download link
|
||||
channel.close();
|
||||
System.out.println("Download Link: "+channel.getDownloadLink());
|
||||
@@ -1,18 +1,21 @@
|
||||
<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">
|
||||
<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>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>httpchannel-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
|
||||
<name>HttpChannel/API</name>
|
||||
<description>Module that defines the HttpChannel API. HttpChannels abstract complex download and upload steps into a simple and easy to use NIO Channel. NIO Channels can be wrapped into an InputStream or OutputStream and used in any way you may find possible to. Aside from that, Channels can be used natively in most next-gen libraries, meaning that you don't even need to wrap anything, just start writing or reading data to or from the channel wth a ByteBuffer.
|
||||
|
||||
|
||||
|
||||
Anyone using the library should try to rely on code from this module only and, only if necessary, on configuration classes that are implementation specific. Relying on any other resource or class is considered an error and should NOT be done.
|
||||
|
||||
One of the most interesting usages of channels for uploads and download is that you can easily copy data straight from one channel to the other, with less than 10 lines of code! Also, channels allows the implementation of a "tee" mechanism, in which data redden from a single channel can be copied to several other channels on the fly!</description>
|
||||
One of the most interesting usages of channels for uploads and download is that you can easily copy data straight from one channel to the other, with less than 10 lines of code! Also, channels allows the implementation of a "tee" mechanism, in which data redden from a single channel can be copied to several other channels on the fly!</description>
|
||||
<url>http://httpchannel.github.com/httpchannel-api/</url>
|
||||
</project>
|
||||
@@ -24,6 +24,7 @@ import org.slf4j.LoggerFactory;
|
||||
import com.rogiel.httpchannel.captcha.Captcha;
|
||||
import com.rogiel.httpchannel.captcha.CaptchaService;
|
||||
import com.rogiel.httpchannel.captcha.exception.UnsolvableCaptchaServiceException;
|
||||
import com.rogiel.httpchannel.service.AccountDetails.PremiumAccountDetails;
|
||||
import com.rogiel.httpchannel.service.exception.NoCaptchaServiceException;
|
||||
|
||||
/**
|
||||
@@ -41,9 +42,9 @@ public abstract class AbstractService implements Service {
|
||||
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
/**
|
||||
* The currently active service mode
|
||||
* The currently active account
|
||||
*/
|
||||
protected ServiceMode serviceMode = ServiceMode.UNAUTHENTICATED;
|
||||
protected AccountDetails account;
|
||||
|
||||
/**
|
||||
* This service {@link CaptchaService} that is used to resolve CAPTCHAS
|
||||
@@ -52,7 +53,16 @@ public abstract class AbstractService implements Service {
|
||||
|
||||
@Override
|
||||
public ServiceMode getServiceMode() {
|
||||
return serviceMode;
|
||||
if (account == null) {
|
||||
return ServiceMode.UNAUTHENTICATED;
|
||||
} else {
|
||||
if (account.is(PremiumAccountDetails.class)) {
|
||||
return (account.as(PremiumAccountDetails.class).isPremium() ? ServiceMode.PREMIUM
|
||||
: ServiceMode.NON_PREMIUM);
|
||||
} else {
|
||||
return ServiceMode.NON_PREMIUM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
/*
|
||||
* 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 com.rogiel.httpchannel.service;
|
||||
|
||||
/**
|
||||
* An {@link AccountDetails} instance can provide several information about an
|
||||
* authenticated account. This instance itself provides little information,
|
||||
* restricted to whether the account {@link #isActive() is active} and its
|
||||
* {@link #getUsername() username}. More details are provided by additional
|
||||
* interfaces:
|
||||
* <ul>
|
||||
* <li>{@link PremiumAccountDetails} - for services that provide premium
|
||||
* accounts</li>
|
||||
* <li>{@link DiskQuotaAccountDetails} - for services that have limited disk
|
||||
* quota</li>
|
||||
* <li>{@link BandwidthQuotaAccountDetails} - for services that have limited
|
||||
* bandwidth quota</li>
|
||||
* <li>{@link FilesizeLimitAccountDetails} - for services that have limited file
|
||||
* sizes depending on the account</li>
|
||||
* </ul>
|
||||
* You should not try to cast instances by yourself, instead they should be
|
||||
* safely casted as such:
|
||||
*
|
||||
* <pre>
|
||||
* final {@link AccountDetails} details = ...;
|
||||
* if(details.{@link #is(Class) is}({@link PremiumAccountDetails}.class)) {
|
||||
* details.{@link #as(Class) as}({@link PremiumAccountDetails}.class).{@link PremiumAccountDetails#isPremium() isPremium()};
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* A single {@link AccountDetails} can implement none, one extended or even more
|
||||
* than one extended details interfaces, however all instances are required to
|
||||
* implement at least the basic methods defined in this interface.
|
||||
* <p>
|
||||
* Services could implement their own methods for details, but this should be
|
||||
* avoided because it would make user code dependent on implementation meta data
|
||||
* which is not stable and could break compatibility with other implementation
|
||||
* versions. If possible, it is recommended to add a new interface into the API
|
||||
* module.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
* @since 1.0
|
||||
*/
|
||||
public interface AccountDetails {
|
||||
/**
|
||||
* @return the account username
|
||||
*/
|
||||
String getUsername();
|
||||
|
||||
/**
|
||||
* @return <code>true</code> if the account is currently active
|
||||
*/
|
||||
boolean isActive();
|
||||
|
||||
/**
|
||||
* @return the service that provided this account
|
||||
*/
|
||||
AuthenticationService<?> getService();
|
||||
|
||||
/**
|
||||
* Checks whether the account object can be casted to <code>type</code>
|
||||
*
|
||||
* @param type
|
||||
* the casting type
|
||||
* @return <code>true</code> if this object can be casted to
|
||||
* <code>type</code>
|
||||
*/
|
||||
boolean is(Class<? extends AccountDetails> type);
|
||||
|
||||
/**
|
||||
* Casts this object to <code>type</code>. If cannot be casted,
|
||||
* <code>null</code> is returned.
|
||||
*
|
||||
* @param type
|
||||
* the casting type
|
||||
* @return the casted account
|
||||
*/
|
||||
<T extends AccountDetails> T as(Class<T> type);
|
||||
|
||||
/**
|
||||
* Service accounts that has premium accounts must implement this interface
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface PremiumAccountDetails extends AccountDetails {
|
||||
/**
|
||||
* @return <code>true</code> if the account is premium
|
||||
*/
|
||||
boolean isPremium();
|
||||
}
|
||||
|
||||
/**
|
||||
* Service accounts that has accounts with limited disk space should
|
||||
* implement this interface
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface DiskQuotaAccountDetails extends AccountDetails {
|
||||
/**
|
||||
* @return the currently free disk space. <code>-1</code> means no limit
|
||||
*/
|
||||
long getFreeDiskSpace();
|
||||
|
||||
/**
|
||||
* @return the currently used disk space. Cannot be negative.
|
||||
*/
|
||||
long getUsedDiskSpace();
|
||||
|
||||
/**
|
||||
* @return the maximum amount of disk space. <code>-1</code> means no
|
||||
* limit
|
||||
*/
|
||||
long getMaximumDiskSpace();
|
||||
}
|
||||
|
||||
/**
|
||||
* Service accounts that has accounts with limited bandwidth should
|
||||
* implement this interface
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface BandwidthQuotaAccountDetails extends AccountDetails {
|
||||
/**
|
||||
* @return the currently free bandwidth. <code>-1</code> means no limit
|
||||
*/
|
||||
long getFreeBandwidth();
|
||||
|
||||
/**
|
||||
* @return the currently used bandwidth. Cannot be negative.
|
||||
*/
|
||||
long getUsedBandwidth();
|
||||
|
||||
/**
|
||||
* @return the maximum amount of bandwidth available. <code>-1</code>
|
||||
* means no limit
|
||||
*/
|
||||
long getMaximumBandwidth();
|
||||
}
|
||||
|
||||
/**
|
||||
* Service accounts that has accounts with hotlink traffic should implement
|
||||
* this interface
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface HotLinkingAccountDetails extends AccountDetails {
|
||||
/**
|
||||
* @return the currently free hotlink traffic. <code>-1</code> means no
|
||||
* limit
|
||||
*/
|
||||
long getHotlinkTraffic();
|
||||
}
|
||||
|
||||
/**
|
||||
* Service accounts that has accounts with limited bandwidth should
|
||||
* implement this interface
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface FilesizeLimitAccountDetails extends AccountDetails {
|
||||
/**
|
||||
* @return the maximum filesize for the account. <code>-1</code> means
|
||||
* no limit
|
||||
*/
|
||||
long getMaximumFilesize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Service accounts that has referring support
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface ReferralAccountDetails extends AccountDetails {
|
||||
/**
|
||||
* @return the number of members referred
|
||||
*/
|
||||
int getMembersReferred();
|
||||
|
||||
/**
|
||||
* @return the account referral URL
|
||||
*/
|
||||
String getReferralURL();
|
||||
}
|
||||
|
||||
/**
|
||||
* Service account that has points attached to it (normally acquired through
|
||||
* downloads of files from the account)
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface PointAccountDetails extends AccountDetails {
|
||||
/**
|
||||
* @return the number of point on the account
|
||||
*/
|
||||
int getPoints();
|
||||
}
|
||||
}
|
||||
@@ -69,4 +69,10 @@ public interface AuthenticationService<C extends AuthenticatorConfiguration>
|
||||
* @see AuthenticatorCapability
|
||||
*/
|
||||
CapabilityMatrix<AuthenticatorCapability> getAuthenticationCapability();
|
||||
|
||||
/**
|
||||
* @return the currently authenticated account. Can be <code>null</code> and
|
||||
* this indicates that the service is not authenticated.
|
||||
*/
|
||||
AccountDetails getAccountDetails();
|
||||
}
|
||||
|
||||
@@ -38,6 +38,16 @@ public interface Authenticator<C extends AuthenticatorConfiguration> {
|
||||
* persistent for the entire service's operation.<br>
|
||||
* <b>Note</b>: If you want to logout the user, see
|
||||
* {@link Authenticator#logout()}
|
||||
* <p>
|
||||
* Return <code>null</code> is only allowed if
|
||||
* {@link AuthenticatorCapability#ACCOUNT_DETAILS} is not supported by the
|
||||
* service.
|
||||
*
|
||||
* @return the authenticated account {@link AccountDetails}. If
|
||||
* {@link AuthenticationService#getAuthenticationCapability()}
|
||||
* contains {@link AuthenticatorCapability#ACCOUNT_DETAILS}
|
||||
* <code>null</code> cannot be returned. Otherwise,
|
||||
* <code>null</code> should always be returned.
|
||||
*
|
||||
* @throws IOException
|
||||
* if any IO error occur
|
||||
@@ -51,7 +61,8 @@ public interface Authenticator<C extends AuthenticatorConfiguration> {
|
||||
* if the service required an {@link CaptchaService}
|
||||
* implementation to be present, but none was available
|
||||
*/
|
||||
void login() throws IOException, AuthenticationInvalidCredentialException,
|
||||
AccountDetails login() throws IOException,
|
||||
AuthenticationInvalidCredentialException,
|
||||
UnsolvableCaptchaServiceException, NoCaptchaServiceException;
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,7 @@ package com.rogiel.httpchannel.service;
|
||||
*/
|
||||
public enum AuthenticatorCapability {
|
||||
/**
|
||||
* Mark an {@link Authenticator} capable of fetching account information.
|
||||
* Mark an {@link Authenticator} capable of providing account details.
|
||||
*/
|
||||
FETCH_ACCOUNT_INFORMATION;
|
||||
ACCOUNT_DETAILS;
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ package com.rogiel.httpchannel.service.helper;
|
||||
|
||||
import com.rogiel.httpchannel.service.AuthenticationService;
|
||||
import com.rogiel.httpchannel.service.Authenticator;
|
||||
import com.rogiel.httpchannel.service.Authenticator.AuthenticatorConfiguration;
|
||||
import com.rogiel.httpchannel.service.Credential;
|
||||
import com.rogiel.httpchannel.service.Authenticator.AuthenticatorConfiguration;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
|
||||
23
httpchannel-api/src/main/resources/META-INF/MANIFEST.MF
Normal file
23
httpchannel-api/src/main/resources/META-INF/MANIFEST.MF
Normal file
@@ -0,0 +1,23 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: HttpChannel API
|
||||
Bundle-SymbolicName: com.rogiel.httpchannel;singleton:=true
|
||||
Bundle-Version: 1.0.0
|
||||
Export-Package: com.rogiel.httpchannel.captcha,
|
||||
com.rogiel.httpchannel.captcha.exception;uses:="com.rogiel.httpchannel.service.exception",
|
||||
com.rogiel.httpchannel.channel;uses:="com.rogiel.httpchannel.service",
|
||||
com.rogiel.httpchannel.osgi;uses:="org.osgi.framework",
|
||||
com.rogiel.httpchannel.service;uses:="com.rogiel.httpchannel.captcha,org.slf4j",
|
||||
com.rogiel.httpchannel.service.config;uses:="com.rogiel.httpchannel.service",
|
||||
com.rogiel.httpchannel.service.exception,
|
||||
com.rogiel.httpchannel.service.helper;uses:="com.rogiel.httpchannel.service"
|
||||
Bundle-Activator: com.rogiel.httpchannel.osgi.Activator
|
||||
Import-Package: com.rogiel.httpchannel.captcha,
|
||||
com.rogiel.httpchannel.captcha.exception,
|
||||
com.rogiel.httpchannel.channel,
|
||||
com.rogiel.httpchannel.osgi,
|
||||
com.rogiel.httpchannel.service,
|
||||
com.rogiel.httpchannel.service.config,
|
||||
com.rogiel.httpchannel.service.exception,
|
||||
com.rogiel.httpchannel.service.helper, org.osgi.framework
|
||||
|
||||
36
httpchannel-api/src/site/xdoc/seekable-download-channel.xml
Normal file
36
httpchannel-api/src/site/xdoc/seekable-download-channel.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
|
||||
<properties>
|
||||
<title>Home</title>
|
||||
<author email="rogiel@rogiel.com">Rogiel Sulzbach</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<!-- The body of the document contains a number of sections -->
|
||||
<section name="SeekableDownloadChannel">
|
||||
<p>
|
||||
The
|
||||
<b>SeekableDownloadChannel</b>
|
||||
allows you to emulate the download stream as if it was a local file:
|
||||
you can go back and forth. All of that comes at a cost, you need to
|
||||
restart the download everytime you set the channel position.
|
||||
</p>
|
||||
|
||||
<source><![CDATA[final DownloadChannel downloadChannel = ...; // open a download channel here
|
||||
final SeekableDownloadChannel channel = new SeekableDownloadChannel(downloadChannel);
|
||||
channel.position(12 * 1024);]]></source>
|
||||
<small>
|
||||
Creates a new
|
||||
<b>SeekableDownloadChannel</b>
|
||||
channel and set its position to the 12288 byte offset.
|
||||
</small>
|
||||
|
||||
<p>
|
||||
If the channel does not support seeking, an
|
||||
<b>IOException</b>
|
||||
is thrown at construction time.
|
||||
</p>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>httpchannel-captcha</artifactId>
|
||||
<groupId>com.rogiel.httpchannel</groupId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<groupId>com.rogiel.httpchannel.captcha</groupId>
|
||||
|
||||
@@ -1,9 +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">
|
||||
<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>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>httpchannel-captcha</artifactId>
|
||||
@@ -19,7 +20,7 @@
|
||||
<dependency>
|
||||
<groupId>com.rogiel.httpchannel</groupId>
|
||||
<artifactId>httpchannel-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>httpchannel</artifactId>
|
||||
<groupId>com.rogiel.httpchannel</groupId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>httpchannel-channelcopy</artifactId>
|
||||
@@ -13,18 +13,18 @@
|
||||
<dependency>
|
||||
<groupId>com.rogiel.httpchannel</groupId>
|
||||
<artifactId>httpchannel-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rogiel.httpchannel.services</groupId>
|
||||
<artifactId>httpchannel-service-megaupload</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rogiel.httpchannel.services</groupId>
|
||||
<artifactId>httpchannel-service-multiupload</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -19,20 +19,26 @@
|
||||
package com.rogiel.httpchannel.wirecopy;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.rogiel.httpchannel.copy.ChannelCopy;
|
||||
import com.rogiel.httpchannel.service.impl.MegaUploadService;
|
||||
import com.rogiel.httpchannel.service.impl.MultiUploadService;
|
||||
import com.rogiel.httpchannel.service.ServiceID;
|
||||
import com.rogiel.httpchannel.service.helper.Services;
|
||||
|
||||
public class ChannelCopyTest {
|
||||
@Test
|
||||
public void testWireCopy() throws IOException {
|
||||
final ChannelCopy copy = new ChannelCopy(Paths.get("pom.xml"));
|
||||
copy.addOutput(new MegaUploadService());
|
||||
copy.addOutput(new MultiUploadService());
|
||||
System.out.println(copy.call());
|
||||
|
||||
copy.addOutput(Services.getUploadService(ServiceID.create("megaupload")));
|
||||
copy.addOutput(Services.getUploadService(ServiceID.create("hotfile")));
|
||||
copy.addOutput(Services.getUploadService(ServiceID.create("depositfiles")));
|
||||
|
||||
final List<URI> downloadUris = copy.call();
|
||||
System.out.println(downloadUris);
|
||||
}
|
||||
}
|
||||
|
||||
14
httpchannel-service/httpchannel-service-2shared/pom.xml
Normal file
14
httpchannel-service/httpchannel-service-2shared/pom.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>httpchannel-service-2shared</artifactId>
|
||||
<groupId>com.rogiel.httpchannel.service</groupId>
|
||||
<name>HttpChannel/Service/TwoShared</name>
|
||||
<description>Provides download and upload access for 2shared.com</description>
|
||||
</project>
|
||||
@@ -0,0 +1,241 @@
|
||||
/*
|
||||
* 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 com.rogiel.httpchannel.service.twoshared;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.rogiel.httpchannel.captcha.exception.UnsolvableCaptchaServiceException;
|
||||
import com.rogiel.httpchannel.service.AbstractHttpDownloader;
|
||||
import com.rogiel.httpchannel.service.AbstractHttpService;
|
||||
import com.rogiel.httpchannel.service.AbstractUploader;
|
||||
import com.rogiel.httpchannel.service.CapabilityMatrix;
|
||||
import com.rogiel.httpchannel.service.DownloadChannel;
|
||||
import com.rogiel.httpchannel.service.DownloadListener;
|
||||
import com.rogiel.httpchannel.service.DownloadService;
|
||||
import com.rogiel.httpchannel.service.Downloader;
|
||||
import com.rogiel.httpchannel.service.DownloaderCapability;
|
||||
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.NullDownloaderConfiguration;
|
||||
import com.rogiel.httpchannel.service.config.NullUploaderConfiguration;
|
||||
import com.rogiel.httpchannel.service.exception.DownloadLimitExceededException;
|
||||
import com.rogiel.httpchannel.service.exception.DownloadLinkNotFoundException;
|
||||
import com.rogiel.httpchannel.service.exception.DownloadNotAuthorizedException;
|
||||
import com.rogiel.httpchannel.service.exception.DownloadNotResumableException;
|
||||
import com.rogiel.httpchannel.service.exception.NoCaptchaServiceException;
|
||||
import com.rogiel.httpchannel.util.ExceptionUtils;
|
||||
import com.rogiel.httpchannel.util.html.Page;
|
||||
|
||||
/**
|
||||
* This service handles uploads to TwoShared.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com/">Rogiel</a>
|
||||
* @since 1.0
|
||||
*/
|
||||
public class TwoSharedService extends AbstractHttpService implements Service,
|
||||
UploadService<NullUploaderConfiguration>,
|
||||
DownloadService<NullDownloaderConfiguration> {
|
||||
/**
|
||||
* This service ID
|
||||
*/
|
||||
public static final ServiceID SERVICE_ID = ServiceID.create("twoshared");
|
||||
|
||||
private static final Pattern UPLOAD_URL_PATTERN = Pattern
|
||||
.compile("http://dc[0-9]*\\.2shared\\.com/main/upload2\\.jsp\\?sId=[A-z0-9]*");
|
||||
private static final Pattern UPLOAD_ID_PATTERN = Pattern
|
||||
.compile("sId=([A-z0-9]*)");
|
||||
|
||||
private static final Pattern DOWNLOAD_URL_PATTERN = Pattern
|
||||
.compile("http://(www\\.)?2shared\\.com/document/[A-z0-9]*/.*");
|
||||
private static final Pattern DIRECT_DOWNLOAD_URL_PATTERN = Pattern
|
||||
.compile("http://dc[0-9]+\\.2shared\\.com/download/[A-z0-9]+/.+\\?tsid=[0-9]{8}-[0-9]{6}-[A-z0-9]{8}");
|
||||
|
||||
@Override
|
||||
public ServiceID getServiceID() {
|
||||
return SERVICE_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMajorVersion() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinorVersion() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CapabilityMatrix<ServiceMode> getPossibleServiceModes() {
|
||||
return new CapabilityMatrix<ServiceMode>(ServiceMode.UNAUTHENTICATED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uploader<NullUploaderConfiguration> getUploader(String filename,
|
||||
long filesize, NullUploaderConfiguration configuration) {
|
||||
return new UploaderImpl(filename, filesize, configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uploader<NullUploaderConfiguration> 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<UploaderCapability> getUploadCapabilities() {
|
||||
return new CapabilityMatrix<UploaderCapability>(
|
||||
UploaderCapability.UNAUTHENTICATED_UPLOAD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Downloader<NullDownloaderConfiguration> getDownloader(URI uri,
|
||||
NullDownloaderConfiguration configuration) {
|
||||
return new DownloaderImpl(uri, configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Downloader<NullDownloaderConfiguration> getDownloader(URI uri) {
|
||||
return getDownloader(uri, newDownloaderConfiguration());
|
||||
}
|
||||
|
||||
@Override
|
||||
public NullDownloaderConfiguration newDownloaderConfiguration() {
|
||||
return NullDownloaderConfiguration.SHARED_INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matchURI(URI uri) {
|
||||
return DOWNLOAD_URL_PATTERN.matcher(uri.toString()).matches();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CapabilityMatrix<DownloaderCapability> getDownloadCapabilities() {
|
||||
return new CapabilityMatrix<DownloaderCapability>(
|
||||
DownloaderCapability.UNAUTHENTICATED_DOWNLOAD,
|
||||
DownloaderCapability.UNAUTHENTICATED_RESUME);
|
||||
}
|
||||
|
||||
private class UploaderImpl extends
|
||||
AbstractUploader<NullUploaderConfiguration> implements
|
||||
Uploader<NullUploaderConfiguration>,
|
||||
LinkedUploadChannelCloseCallback {
|
||||
private Future<Page> uploadFuture;
|
||||
private String uploadID;
|
||||
|
||||
public UploaderImpl(String filename, long filesize,
|
||||
NullUploaderConfiguration configuration) {
|
||||
super(TwoSharedService.this, filename, filesize, configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UploadChannel openChannel() throws IOException {
|
||||
logger.debug("Starting upload to TwoShared");
|
||||
final Page page = get("http://www.2shared.com/").asPage();
|
||||
|
||||
// locate upload uri
|
||||
final String uri = page.form(UPLOAD_URL_PATTERN).asString();
|
||||
final String mainDC = page.inputByName("mainDC").asString();
|
||||
uploadID = page.search(UPLOAD_ID_PATTERN).asString(1);
|
||||
|
||||
logger.debug("Upload URI: {}, DC: {}", uri, mainDC);
|
||||
|
||||
// create a new channel
|
||||
final LinkedUploadChannel channel = createLinkedChannel(this);
|
||||
uploadFuture = multipartPost(uri).parameter("fff", channel)
|
||||
.parameter("mainDC", mainDC).asPageAsync();
|
||||
|
||||
// wait for channel link
|
||||
return waitChannelLink(channel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String finish() throws IOException {
|
||||
try {
|
||||
uploadFuture.get();
|
||||
final Page page = get(
|
||||
"http://www.2shared.com/uploadComplete.jsp?sId="
|
||||
+ uploadID).asPage();
|
||||
return page.textareaByID("downloadLink").asString();
|
||||
} catch (InterruptedException e) {
|
||||
return null;
|
||||
} catch (ExecutionException e) {
|
||||
ExceptionUtils.asIOException(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class DownloaderImpl extends
|
||||
AbstractHttpDownloader<NullDownloaderConfiguration> implements
|
||||
Downloader<NullDownloaderConfiguration> {
|
||||
/**
|
||||
* @param uri
|
||||
* the download uri
|
||||
* @param configuration
|
||||
* the downloader configuration
|
||||
*/
|
||||
protected DownloaderImpl(URI uri,
|
||||
NullDownloaderConfiguration configuration) {
|
||||
super(TwoSharedService.this, uri, configuration);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public DownloadChannel openChannel(DownloadListener listener,
|
||||
long position) throws IOException,
|
||||
DownloadLinkNotFoundException, DownloadLimitExceededException,
|
||||
DownloadNotAuthorizedException, DownloadNotResumableException,
|
||||
UnsolvableCaptchaServiceException, NoCaptchaServiceException {
|
||||
final Page page = get(uri).asPage();
|
||||
final String downloadUri = page.script(
|
||||
DIRECT_DOWNLOAD_URL_PATTERN).asString();
|
||||
return download(get(downloadUri));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
com.rogiel.httpchannel.service.twoshared.TwoSharedService
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* 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 com.rogiel.httpchannel.service.twoshared;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.rogiel.httpchannel.service.Downloader;
|
||||
import com.rogiel.httpchannel.util.ChannelUtils;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class TwoSharedServiceTest {
|
||||
private final TwoSharedService service = new TwoSharedService();
|
||||
|
||||
@Test
|
||||
public void testUpload() throws IOException {
|
||||
final Path path = Paths
|
||||
.get("../src/test/resources/upload-test-file.txt");
|
||||
final URI uri = ChannelUtils.upload(service, path);
|
||||
|
||||
Assert.assertNotNull(uri);
|
||||
System.out.println(uri);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDownload() throws IOException {
|
||||
final Downloader<?> downloader = service
|
||||
.getDownloader(URI
|
||||
.create("http://www.2shared.com/document/04tjgnAr/upload-test-file.html"));
|
||||
System.out.println(new String(ChannelUtils.toByteArray(downloader.openChannel())));
|
||||
}
|
||||
}
|
||||
28
httpchannel-service/httpchannel-service-4shared/pom.xml
Normal file
28
httpchannel-service/httpchannel-service-4shared/pom.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>httpchannel-service-4shared</artifactId>
|
||||
<groupId>com.rogiel.httpchannel.services</groupId>
|
||||
<name>HttpChannel/Service/4Shared</name>
|
||||
<description>Provides upload access to 4shared.com</description>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>javax.xml.ws</groupId>
|
||||
<artifactId>jaxws-api</artifactId>
|
||||
<version>2.2.7</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.ws</groupId>
|
||||
<artifactId>jaxws-rt</artifactId>
|
||||
<version>2.2.7-promoted-b09</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,313 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for accountItem complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="accountItem">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="date" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
|
||||
* <element name="directory" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="downloadCount" type="{http://www.w3.org/2001/XMLSchema}int"/>
|
||||
* <element name="downloadLink" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="empty" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="id" type="{http://www.w3.org/2001/XMLSchema}long"/>
|
||||
* <element name="md5" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="parentId" type="{http://www.w3.org/2001/XMLSchema}long"/>
|
||||
* <element name="removed" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="shared" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="size" type="{http://www.w3.org/2001/XMLSchema}long"/>
|
||||
* <element name="version" type="{http://www.w3.org/2001/XMLSchema}int"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "accountItem", propOrder = {
|
||||
"date",
|
||||
"directory",
|
||||
"downloadCount",
|
||||
"downloadLink",
|
||||
"empty",
|
||||
"id",
|
||||
"md5",
|
||||
"name",
|
||||
"parentId",
|
||||
"removed",
|
||||
"shared",
|
||||
"size",
|
||||
"version"
|
||||
})
|
||||
public class AccountItem {
|
||||
|
||||
protected XMLGregorianCalendar date;
|
||||
protected boolean directory;
|
||||
protected int downloadCount;
|
||||
protected String downloadLink;
|
||||
protected boolean empty;
|
||||
protected long id;
|
||||
protected String md5;
|
||||
protected String name;
|
||||
protected long parentId;
|
||||
protected boolean removed;
|
||||
protected boolean shared;
|
||||
protected long size;
|
||||
protected int version;
|
||||
|
||||
/**
|
||||
* Gets the value of the date property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link XMLGregorianCalendar }
|
||||
*
|
||||
*/
|
||||
public XMLGregorianCalendar getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the date property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link XMLGregorianCalendar }
|
||||
*
|
||||
*/
|
||||
public void setDate(XMLGregorianCalendar value) {
|
||||
this.date = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the directory property.
|
||||
*
|
||||
*/
|
||||
public boolean isDirectory() {
|
||||
return directory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the directory property.
|
||||
*
|
||||
*/
|
||||
public void setDirectory(boolean value) {
|
||||
this.directory = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the downloadCount property.
|
||||
*
|
||||
*/
|
||||
public int getDownloadCount() {
|
||||
return downloadCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the downloadCount property.
|
||||
*
|
||||
*/
|
||||
public void setDownloadCount(int value) {
|
||||
this.downloadCount = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the downloadLink property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getDownloadLink() {
|
||||
return downloadLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the downloadLink property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setDownloadLink(String value) {
|
||||
this.downloadLink = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the empty property.
|
||||
*
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
return empty;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the empty property.
|
||||
*
|
||||
*/
|
||||
public void setEmpty(boolean value) {
|
||||
this.empty = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the id property.
|
||||
*
|
||||
*/
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the id property.
|
||||
*
|
||||
*/
|
||||
public void setId(long value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the md5 property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getMd5() {
|
||||
return md5;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the md5 property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setMd5(String value) {
|
||||
this.md5 = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the name property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the name property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setName(String value) {
|
||||
this.name = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the parentId property.
|
||||
*
|
||||
*/
|
||||
public long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the parentId property.
|
||||
*
|
||||
*/
|
||||
public void setParentId(long value) {
|
||||
this.parentId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the removed property.
|
||||
*
|
||||
*/
|
||||
public boolean isRemoved() {
|
||||
return removed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the removed property.
|
||||
*
|
||||
*/
|
||||
public void setRemoved(boolean value) {
|
||||
this.removed = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the shared property.
|
||||
*
|
||||
*/
|
||||
public boolean isShared() {
|
||||
return shared;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the shared property.
|
||||
*
|
||||
*/
|
||||
public void setShared(boolean value) {
|
||||
this.shared = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the size property.
|
||||
*
|
||||
*/
|
||||
public long getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the size property.
|
||||
*
|
||||
*/
|
||||
public void setSize(long value) {
|
||||
this.size = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the version property.
|
||||
*
|
||||
*/
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the version property.
|
||||
*
|
||||
*/
|
||||
public void setVersion(int value) {
|
||||
this.version = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for accountItemArray complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="accountItemArray">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="item" type="{http://api.soap.shared.pmstation.com/}accountItem" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "accountItemArray", propOrder = {
|
||||
"item"
|
||||
})
|
||||
public class AccountItemArray {
|
||||
|
||||
@XmlElement(nillable = true)
|
||||
protected List<AccountItem> item;
|
||||
|
||||
/**
|
||||
* Gets the value of the item property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the item property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getItem().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link AccountItem }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<AccountItem> getItem() {
|
||||
if (item == null) {
|
||||
item = new ArrayList<AccountItem>();
|
||||
}
|
||||
return this.item;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import javax.xml.ws.WebFault;
|
||||
|
||||
/**
|
||||
* This class was generated by the JAXWS SI. JAX-WS RI 2.1-02/02/2007 03:56
|
||||
* AM(vivekp)-FCS Generated source version: 2.1
|
||||
*
|
||||
*/
|
||||
@WebFault(name = "ApiException", targetNamespace = "http://api.soap.shared.pmstation.com/")
|
||||
public class ApiException extends Exception {
|
||||
private static final long serialVersionUID = -2632015347300569935L;
|
||||
|
||||
/**
|
||||
* Java type that goes as soapenv:Fault detail element.
|
||||
*
|
||||
*/
|
||||
private FaultBean faultInfo;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param message
|
||||
* @param faultInfo
|
||||
*/
|
||||
public ApiException(String message, FaultBean faultInfo) {
|
||||
super(message);
|
||||
this.faultInfo = faultInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param message
|
||||
* @param faultInfo
|
||||
* @param cause
|
||||
*/
|
||||
public ApiException(String message, FaultBean faultInfo, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.faultInfo = faultInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return returns fault bean: com.pmstation.shared.soap.client.FaultBean
|
||||
*/
|
||||
public FaultBean getFaultInfo() {
|
||||
return faultInfo;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,58 @@
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
import javax.xml.ws.Service;
|
||||
import javax.xml.ws.WebEndpoint;
|
||||
import javax.xml.ws.WebServiceClient;
|
||||
import javax.xml.ws.WebServiceFeature;
|
||||
|
||||
/**
|
||||
* This class was generated by the JAXWS SI. JAX-WS RI 2.1-02/02/2007 03:56
|
||||
* AM(vivekp)-FCS Generated source version: 2.1
|
||||
*
|
||||
*/
|
||||
@WebServiceClient(name = "DesktopAppJax2Service", targetNamespace = "http://api.soap.shared.pmstation.com/", wsdlLocation = "file:///home/tinedel/projects/4shared-api/src/com/pmstation/shared/soap/client/DesktopApp.wsdl")
|
||||
public class DesktopAppJax2Service extends Service {
|
||||
|
||||
private final static URL DESKTOPAPPJAX2SERVICE_WSDL_LOCATION = DesktopAppJax2Service.class.getResource("DesktopApp.wsdl");;
|
||||
|
||||
public DesktopAppJax2Service(URL wsdlLocation, QName serviceName) {
|
||||
super(wsdlLocation, serviceName);
|
||||
}
|
||||
|
||||
public DesktopAppJax2Service() {
|
||||
super(DESKTOPAPPJAX2SERVICE_WSDL_LOCATION, new QName(
|
||||
"http://api.soap.shared.pmstation.com/",
|
||||
"DesktopAppJax2Service"));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return returns DesktopAppJax2
|
||||
*/
|
||||
@WebEndpoint(name = "DesktopAppJax2Port")
|
||||
public DesktopAppJax2 getDesktopAppJax2Port() {
|
||||
return (DesktopAppJax2) super.getPort(new QName(
|
||||
"http://api.soap.shared.pmstation.com/", "DesktopAppJax2Port"),
|
||||
DesktopAppJax2.class);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param features
|
||||
* A list of {@link javax.xml.ws.WebServiceFeature} to configure
|
||||
* on the proxy. Supported features not in the
|
||||
* <code>features</code> parameter will have their default
|
||||
* values.
|
||||
* @return returns DesktopAppJax2
|
||||
*/
|
||||
@WebEndpoint(name = "DesktopAppJax2Port")
|
||||
public DesktopAppJax2 getDesktopAppJax2Port(WebServiceFeature... features) {
|
||||
return (DesktopAppJax2) super.getPort(new QName(
|
||||
"http://api.soap.shared.pmstation.com/", "DesktopAppJax2Port"),
|
||||
DesktopAppJax2.class, features);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for dirHistoryDTO complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="dirHistoryDTO">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="compId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="date" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
|
||||
* <element name="dirId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
|
||||
* <element name="fileId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
|
||||
* <element name="id" type="{http://www.w3.org/2001/XMLSchema}long"/>
|
||||
* <element name="operation" type="{http://www.w3.org/2001/XMLSchema}int"/>
|
||||
* <element name="parentDirId" type="{http://www.w3.org/2001/XMLSchema}long"/>
|
||||
* <element name="sourceDirId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
|
||||
* <element name="sourceFileId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "dirHistoryDTO", propOrder = {
|
||||
"compId",
|
||||
"date",
|
||||
"dirId",
|
||||
"fileId",
|
||||
"id",
|
||||
"operation",
|
||||
"parentDirId",
|
||||
"sourceDirId",
|
||||
"sourceFileId"
|
||||
})
|
||||
public class DirHistoryDTO {
|
||||
|
||||
protected String compId;
|
||||
protected XMLGregorianCalendar date;
|
||||
protected Long dirId;
|
||||
protected Long fileId;
|
||||
protected long id;
|
||||
protected int operation;
|
||||
protected long parentDirId;
|
||||
protected Long sourceDirId;
|
||||
protected Long sourceFileId;
|
||||
|
||||
/**
|
||||
* Gets the value of the compId property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getCompId() {
|
||||
return compId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the compId property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setCompId(String value) {
|
||||
this.compId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the date property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link XMLGregorianCalendar }
|
||||
*
|
||||
*/
|
||||
public XMLGregorianCalendar getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the date property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link XMLGregorianCalendar }
|
||||
*
|
||||
*/
|
||||
public void setDate(XMLGregorianCalendar value) {
|
||||
this.date = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the dirId property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Long }
|
||||
*
|
||||
*/
|
||||
public Long getDirId() {
|
||||
return dirId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the dirId property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Long }
|
||||
*
|
||||
*/
|
||||
public void setDirId(Long value) {
|
||||
this.dirId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the fileId property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Long }
|
||||
*
|
||||
*/
|
||||
public Long getFileId() {
|
||||
return fileId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the fileId property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Long }
|
||||
*
|
||||
*/
|
||||
public void setFileId(Long value) {
|
||||
this.fileId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the id property.
|
||||
*
|
||||
*/
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the id property.
|
||||
*
|
||||
*/
|
||||
public void setId(long value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the operation property.
|
||||
*
|
||||
*/
|
||||
public int getOperation() {
|
||||
return operation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the operation property.
|
||||
*
|
||||
*/
|
||||
public void setOperation(int value) {
|
||||
this.operation = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the parentDirId property.
|
||||
*
|
||||
*/
|
||||
public long getParentDirId() {
|
||||
return parentDirId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the parentDirId property.
|
||||
*
|
||||
*/
|
||||
public void setParentDirId(long value) {
|
||||
this.parentDirId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the sourceDirId property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Long }
|
||||
*
|
||||
*/
|
||||
public Long getSourceDirId() {
|
||||
return sourceDirId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the sourceDirId property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Long }
|
||||
*
|
||||
*/
|
||||
public void setSourceDirId(Long value) {
|
||||
this.sourceDirId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the sourceFileId property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Long }
|
||||
*
|
||||
*/
|
||||
public Long getSourceFileId() {
|
||||
return sourceFileId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the sourceFileId property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Long }
|
||||
*
|
||||
*/
|
||||
public void setSourceFileId(Long value) {
|
||||
this.sourceFileId = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for dirHistoryDTOArray complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="dirHistoryDTOArray">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="item" type="{http://api.soap.shared.pmstation.com/}dirHistoryDTO" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "dirHistoryDTOArray", propOrder = {
|
||||
"item"
|
||||
})
|
||||
public class DirHistoryDTOArray {
|
||||
|
||||
@XmlElement(nillable = true)
|
||||
protected List<DirHistoryDTO> item;
|
||||
|
||||
/**
|
||||
* Gets the value of the item property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the item property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getItem().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link DirHistoryDTO }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<DirHistoryDTO> getItem() {
|
||||
if (item == null) {
|
||||
item = new ArrayList<DirHistoryDTO>();
|
||||
}
|
||||
return this.item;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for dirHistoryDTOArrayArray complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="dirHistoryDTOArrayArray">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="item" type="{http://api.soap.shared.pmstation.com/}dirHistoryDTOArray" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "dirHistoryDTOArrayArray", propOrder = {
|
||||
"item"
|
||||
})
|
||||
public class DirHistoryDTOArrayArray {
|
||||
|
||||
@XmlElement(nillable = true)
|
||||
protected List<DirHistoryDTOArray> item;
|
||||
|
||||
/**
|
||||
* Gets the value of the item property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the item property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getItem().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link DirHistoryDTOArray }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<DirHistoryDTOArray> getItem() {
|
||||
if (item == null) {
|
||||
item = new ArrayList<DirHistoryDTOArray>();
|
||||
}
|
||||
return this.item;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for exifInfo complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="exifInfo">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="dateTime" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="empty" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="fileId" type="{http://www.w3.org/2001/XMLSchema}long"/>
|
||||
* <element name="heigth" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="make" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="model" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="width" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "exifInfo", propOrder = {
|
||||
"dateTime",
|
||||
"empty",
|
||||
"fileId",
|
||||
"heigth",
|
||||
"make",
|
||||
"model",
|
||||
"width"
|
||||
})
|
||||
public class ExifInfo {
|
||||
|
||||
protected String dateTime;
|
||||
protected boolean empty;
|
||||
protected long fileId;
|
||||
protected String heigth;
|
||||
protected String make;
|
||||
protected String model;
|
||||
protected String width;
|
||||
|
||||
/**
|
||||
* Gets the value of the dateTime property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the dateTime property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setDateTime(String value) {
|
||||
this.dateTime = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the empty property.
|
||||
*
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
return empty;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the empty property.
|
||||
*
|
||||
*/
|
||||
public void setEmpty(boolean value) {
|
||||
this.empty = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the fileId property.
|
||||
*
|
||||
*/
|
||||
public long getFileId() {
|
||||
return fileId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the fileId property.
|
||||
*
|
||||
*/
|
||||
public void setFileId(long value) {
|
||||
this.fileId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the heigth property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getHeigth() {
|
||||
return heigth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the heigth property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setHeigth(String value) {
|
||||
this.heigth = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the make property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getMake() {
|
||||
return make;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the make property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setMake(String value) {
|
||||
this.make = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the model property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the model property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setModel(String value) {
|
||||
this.model = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the width property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the width property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setWidth(String value) {
|
||||
this.width = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for exifInfoArray complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="exifInfoArray">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="item" type="{http://api.soap.shared.pmstation.com/}exifInfo" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "exifInfoArray", propOrder = {
|
||||
"item"
|
||||
})
|
||||
public class ExifInfoArray {
|
||||
|
||||
@XmlElement(nillable = true)
|
||||
protected List<ExifInfo> item;
|
||||
|
||||
/**
|
||||
* Gets the value of the item property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the item property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getItem().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link ExifInfo }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<ExifInfo> getItem() {
|
||||
if (item == null) {
|
||||
item = new ArrayList<ExifInfo>();
|
||||
}
|
||||
return this.item;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for faultBean complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="faultBean">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="details" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="exceptionClass" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "faultBean", propOrder = {
|
||||
"details",
|
||||
"exceptionClass"
|
||||
})
|
||||
public class FaultBean {
|
||||
|
||||
protected String details;
|
||||
protected String exceptionClass;
|
||||
|
||||
/**
|
||||
* Gets the value of the details property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getDetails() {
|
||||
return details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the details property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setDetails(String value) {
|
||||
this.details = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the exceptionClass property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getExceptionClass() {
|
||||
return exceptionClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the exceptionClass property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setExceptionClass(String value) {
|
||||
this.exceptionClass = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for fileUploadInfo complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="fileUploadInfo">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="fileId" type="{http://www.w3.org/2001/XMLSchema}long"/>
|
||||
* <element name="freeSpace" type="{http://www.w3.org/2001/XMLSchema}long"/>
|
||||
* <element name="maxFileSize" type="{http://www.w3.org/2001/XMLSchema}long"/>
|
||||
* <element name="message" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="uploadUrl" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "fileUploadInfo", propOrder = {
|
||||
"fileId",
|
||||
"freeSpace",
|
||||
"maxFileSize",
|
||||
"message",
|
||||
"uploadUrl"
|
||||
})
|
||||
public class FileUploadInfo {
|
||||
|
||||
protected long fileId;
|
||||
protected long freeSpace;
|
||||
protected long maxFileSize;
|
||||
protected String message;
|
||||
protected String uploadUrl;
|
||||
|
||||
/**
|
||||
* Gets the value of the fileId property.
|
||||
*
|
||||
*/
|
||||
public long getFileId() {
|
||||
return fileId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the fileId property.
|
||||
*
|
||||
*/
|
||||
public void setFileId(long value) {
|
||||
this.fileId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the freeSpace property.
|
||||
*
|
||||
*/
|
||||
public long getFreeSpace() {
|
||||
return freeSpace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the freeSpace property.
|
||||
*
|
||||
*/
|
||||
public void setFreeSpace(long value) {
|
||||
this.freeSpace = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the maxFileSize property.
|
||||
*
|
||||
*/
|
||||
public long getMaxFileSize() {
|
||||
return maxFileSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the maxFileSize property.
|
||||
*
|
||||
*/
|
||||
public void setMaxFileSize(long value) {
|
||||
this.maxFileSize = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the message property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the message property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setMessage(String value) {
|
||||
this.message = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the uploadUrl property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getUploadUrl() {
|
||||
return uploadUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the uploadUrl property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setUploadUrl(String value) {
|
||||
this.uploadUrl = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for longArray complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="longArray">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="item" type="{http://www.w3.org/2001/XMLSchema}long" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "longArray", namespace = "http://jaxb.dev.java.net/array", propOrder = {
|
||||
"item"
|
||||
})
|
||||
public class LongArray {
|
||||
|
||||
@XmlElement(nillable = true)
|
||||
protected List<Long> item;
|
||||
|
||||
/**
|
||||
* Gets the value of the item property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the item property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getItem().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link Long }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<Long> getItem() {
|
||||
if (item == null) {
|
||||
item = new ArrayList<Long>();
|
||||
}
|
||||
return this.item;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for mp3Info complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="mp3Info">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="album" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="artist" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="bitrate" type="{http://www.w3.org/2001/XMLSchema}int"/>
|
||||
* <element name="empty" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="fileId" type="{http://www.w3.org/2001/XMLSchema}long"/>
|
||||
* <element name="genre" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="length" type="{http://www.w3.org/2001/XMLSchema}int"/>
|
||||
* <element name="preciseLength" type="{http://www.w3.org/2001/XMLSchema}float"/>
|
||||
* <element name="sampleRate" type="{http://www.w3.org/2001/XMLSchema}int"/>
|
||||
* <element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="track" type="{http://www.w3.org/2001/XMLSchema}int"/>
|
||||
* <element name="year" type="{http://www.w3.org/2001/XMLSchema}int"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "mp3Info", propOrder = {
|
||||
"album",
|
||||
"artist",
|
||||
"bitrate",
|
||||
"empty",
|
||||
"fileId",
|
||||
"genre",
|
||||
"length",
|
||||
"preciseLength",
|
||||
"sampleRate",
|
||||
"title",
|
||||
"track",
|
||||
"year"
|
||||
})
|
||||
public class Mp3Info {
|
||||
|
||||
protected String album;
|
||||
protected String artist;
|
||||
protected int bitrate;
|
||||
protected boolean empty;
|
||||
protected long fileId;
|
||||
protected String genre;
|
||||
protected int length;
|
||||
protected float preciseLength;
|
||||
protected int sampleRate;
|
||||
protected String title;
|
||||
protected int track;
|
||||
protected int year;
|
||||
|
||||
/**
|
||||
* Gets the value of the album property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getAlbum() {
|
||||
return album;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the album property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setAlbum(String value) {
|
||||
this.album = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the artist property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getArtist() {
|
||||
return artist;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the artist property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setArtist(String value) {
|
||||
this.artist = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the bitrate property.
|
||||
*
|
||||
*/
|
||||
public int getBitrate() {
|
||||
return bitrate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the bitrate property.
|
||||
*
|
||||
*/
|
||||
public void setBitrate(int value) {
|
||||
this.bitrate = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the empty property.
|
||||
*
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
return empty;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the empty property.
|
||||
*
|
||||
*/
|
||||
public void setEmpty(boolean value) {
|
||||
this.empty = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the fileId property.
|
||||
*
|
||||
*/
|
||||
public long getFileId() {
|
||||
return fileId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the fileId property.
|
||||
*
|
||||
*/
|
||||
public void setFileId(long value) {
|
||||
this.fileId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the genre property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getGenre() {
|
||||
return genre;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the genre property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setGenre(String value) {
|
||||
this.genre = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the length property.
|
||||
*
|
||||
*/
|
||||
public int getLength() {
|
||||
return length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the length property.
|
||||
*
|
||||
*/
|
||||
public void setLength(int value) {
|
||||
this.length = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the preciseLength property.
|
||||
*
|
||||
*/
|
||||
public float getPreciseLength() {
|
||||
return preciseLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the preciseLength property.
|
||||
*
|
||||
*/
|
||||
public void setPreciseLength(float value) {
|
||||
this.preciseLength = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the sampleRate property.
|
||||
*
|
||||
*/
|
||||
public int getSampleRate() {
|
||||
return sampleRate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the sampleRate property.
|
||||
*
|
||||
*/
|
||||
public void setSampleRate(int value) {
|
||||
this.sampleRate = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the title property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the title property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setTitle(String value) {
|
||||
this.title = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the track property.
|
||||
*
|
||||
*/
|
||||
public int getTrack() {
|
||||
return track;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the track property.
|
||||
*
|
||||
*/
|
||||
public void setTrack(int value) {
|
||||
this.track = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the year property.
|
||||
*
|
||||
*/
|
||||
public int getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the year property.
|
||||
*
|
||||
*/
|
||||
public void setYear(int value) {
|
||||
this.year = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for mp3InfoArray complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="mp3InfoArray">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="item" type="{http://api.soap.shared.pmstation.com/}mp3Info" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "mp3InfoArray", propOrder = {
|
||||
"item"
|
||||
})
|
||||
public class Mp3InfoArray {
|
||||
|
||||
@XmlElement(nillable = true)
|
||||
protected List<Mp3Info> item;
|
||||
|
||||
/**
|
||||
* Gets the value of the item property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the item property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getItem().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link Mp3Info }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<Mp3Info> getItem() {
|
||||
if (item == null) {
|
||||
item = new ArrayList<Mp3Info>();
|
||||
}
|
||||
return this.item;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.bind.annotation.XmlElementDecl;
|
||||
import javax.xml.bind.annotation.XmlRegistry;
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
|
||||
/**
|
||||
* This object contains factory methods for each
|
||||
* Java content interface and Java element interface
|
||||
* generated in the com.pmstation.shared.soap.client package.
|
||||
* <p>An ObjectFactory allows you to programatically
|
||||
* construct new instances of the Java representation
|
||||
* for XML content. The Java representation of XML
|
||||
* content can consist of schema derived interfaces
|
||||
* and classes representing the binding of schema
|
||||
* type definitions, element declarations and model
|
||||
* groups. Factory methods for each of these are
|
||||
* provided in this class.
|
||||
*
|
||||
*/
|
||||
@XmlRegistry
|
||||
public class ObjectFactory {
|
||||
|
||||
private final static QName _ApiException_QNAME = new QName("http://api.soap.shared.pmstation.com/", "ApiException");
|
||||
|
||||
/**
|
||||
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.pmstation.shared.soap.client
|
||||
*
|
||||
*/
|
||||
public ObjectFactory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link StringArray }
|
||||
*
|
||||
*/
|
||||
public StringArray createStringArray() {
|
||||
return new StringArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link FileUploadInfo }
|
||||
*
|
||||
*/
|
||||
public FileUploadInfo createFileUploadInfo() {
|
||||
return new FileUploadInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link UserSettings }
|
||||
*
|
||||
*/
|
||||
public UserSettings createUserSettings() {
|
||||
return new UserSettings();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link FaultBean }
|
||||
*
|
||||
*/
|
||||
public FaultBean createFaultBean() {
|
||||
return new FaultBean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link ExifInfo }
|
||||
*
|
||||
*/
|
||||
public ExifInfo createExifInfo() {
|
||||
return new ExifInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link UserSetting }
|
||||
*
|
||||
*/
|
||||
public UserSetting createUserSetting() {
|
||||
return new UserSetting();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link DirHistoryDTOArrayArray }
|
||||
*
|
||||
*/
|
||||
public DirHistoryDTOArrayArray createDirHistoryDTOArrayArray() {
|
||||
return new DirHistoryDTOArrayArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link ExifInfoArray }
|
||||
*
|
||||
*/
|
||||
public ExifInfoArray createExifInfoArray() {
|
||||
return new ExifInfoArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link AccountItemArray }
|
||||
*
|
||||
*/
|
||||
public AccountItemArray createAccountItemArray() {
|
||||
return new AccountItemArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link AccountItem }
|
||||
*
|
||||
*/
|
||||
public AccountItem createAccountItem() {
|
||||
return new AccountItem();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link DirHistoryDTOArray }
|
||||
*
|
||||
*/
|
||||
public DirHistoryDTOArray createDirHistoryDTOArray() {
|
||||
return new DirHistoryDTOArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Mp3Info }
|
||||
*
|
||||
*/
|
||||
public Mp3Info createMp3Info() {
|
||||
return new Mp3Info();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link SharedFolderPropertiesArray }
|
||||
*
|
||||
*/
|
||||
public SharedFolderPropertiesArray createSharedFolderPropertiesArray() {
|
||||
return new SharedFolderPropertiesArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link DirHistoryDTO }
|
||||
*
|
||||
*/
|
||||
public DirHistoryDTO createDirHistoryDTO() {
|
||||
return new DirHistoryDTO();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link SettingsGroup }
|
||||
*
|
||||
*/
|
||||
public SettingsGroup createSettingsGroup() {
|
||||
return new SettingsGroup();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Mp3InfoArray }
|
||||
*
|
||||
*/
|
||||
public Mp3InfoArray createMp3InfoArray() {
|
||||
return new Mp3InfoArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link SharedFolderProperties }
|
||||
*
|
||||
*/
|
||||
public SharedFolderProperties createSharedFolderProperties() {
|
||||
return new SharedFolderProperties();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link LongArray }
|
||||
*
|
||||
*/
|
||||
public LongArray createLongArray() {
|
||||
return new LongArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link SettingsGroupArray }
|
||||
*
|
||||
*/
|
||||
public SettingsGroupArray createSettingsGroupArray() {
|
||||
return new SettingsGroupArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link UserSettingsArray }
|
||||
*
|
||||
*/
|
||||
public UserSettingsArray createUserSettingsArray() {
|
||||
return new UserSettingsArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link FaultBean }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "http://api.soap.shared.pmstation.com/", name = "ApiException")
|
||||
public JAXBElement<FaultBean> createApiException(FaultBean value) {
|
||||
return new JAXBElement<FaultBean>(_ApiException_QNAME, FaultBean.class, null, value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for settingsGroup complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="settingsGroup">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="groupId" type="{http://www.w3.org/2001/XMLSchema}int"/>
|
||||
* <element name="groupName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="translatedName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "settingsGroup", propOrder = {
|
||||
"groupId",
|
||||
"groupName",
|
||||
"translatedName"
|
||||
})
|
||||
public class SettingsGroup {
|
||||
|
||||
protected int groupId;
|
||||
protected String groupName;
|
||||
protected String translatedName;
|
||||
|
||||
/**
|
||||
* Gets the value of the groupId property.
|
||||
*
|
||||
*/
|
||||
public int getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the groupId property.
|
||||
*
|
||||
*/
|
||||
public void setGroupId(int value) {
|
||||
this.groupId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the groupName property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the groupName property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setGroupName(String value) {
|
||||
this.groupName = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the translatedName property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getTranslatedName() {
|
||||
return translatedName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the translatedName property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setTranslatedName(String value) {
|
||||
this.translatedName = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for settingsGroupArray complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="settingsGroupArray">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="item" type="{http://api.soap.shared.pmstation.com/}settingsGroup" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "settingsGroupArray", propOrder = {
|
||||
"item"
|
||||
})
|
||||
public class SettingsGroupArray {
|
||||
|
||||
@XmlElement(nillable = true)
|
||||
protected List<SettingsGroup> item;
|
||||
|
||||
/**
|
||||
* Gets the value of the item property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the item property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getItem().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link SettingsGroup }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<SettingsGroup> getItem() {
|
||||
if (item == null) {
|
||||
item = new ArrayList<SettingsGroup>();
|
||||
}
|
||||
return this.item;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,429 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for sharedFolderProperties complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="sharedFolderProperties">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="createSubFolders" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="delete" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="disableAnonimUpload" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="emailOnUpload" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="embed" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="fileProperties" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="moderator" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="onlyPublic" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="password" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="publicSearch" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="search" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="shared" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="subdomainAllowed" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="subdomainName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="thumbNailOn" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="updateFiles" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="upload" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="viewModeDetails" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="viewSubfolders" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="webGrab" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "sharedFolderProperties", propOrder = {
|
||||
"createSubFolders",
|
||||
"delete",
|
||||
"disableAnonimUpload",
|
||||
"emailOnUpload",
|
||||
"embed",
|
||||
"fileProperties",
|
||||
"moderator",
|
||||
"onlyPublic",
|
||||
"password",
|
||||
"publicSearch",
|
||||
"search",
|
||||
"shared",
|
||||
"subdomainAllowed",
|
||||
"subdomainName",
|
||||
"thumbNailOn",
|
||||
"updateFiles",
|
||||
"upload",
|
||||
"viewModeDetails",
|
||||
"viewSubfolders",
|
||||
"webGrab"
|
||||
})
|
||||
public class SharedFolderProperties {
|
||||
|
||||
protected boolean createSubFolders;
|
||||
protected boolean delete;
|
||||
protected boolean disableAnonimUpload;
|
||||
protected boolean emailOnUpload;
|
||||
protected boolean embed;
|
||||
protected boolean fileProperties;
|
||||
protected boolean moderator;
|
||||
protected boolean onlyPublic;
|
||||
protected String password;
|
||||
protected boolean publicSearch;
|
||||
protected boolean search;
|
||||
protected boolean shared;
|
||||
protected boolean subdomainAllowed;
|
||||
protected String subdomainName;
|
||||
protected boolean thumbNailOn;
|
||||
protected boolean updateFiles;
|
||||
protected boolean upload;
|
||||
protected boolean viewModeDetails;
|
||||
protected boolean viewSubfolders;
|
||||
protected boolean webGrab;
|
||||
|
||||
/**
|
||||
* Gets the value of the createSubFolders property.
|
||||
*
|
||||
*/
|
||||
public boolean isCreateSubFolders() {
|
||||
return createSubFolders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the createSubFolders property.
|
||||
*
|
||||
*/
|
||||
public void setCreateSubFolders(boolean value) {
|
||||
this.createSubFolders = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the delete property.
|
||||
*
|
||||
*/
|
||||
public boolean isDelete() {
|
||||
return delete;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the delete property.
|
||||
*
|
||||
*/
|
||||
public void setDelete(boolean value) {
|
||||
this.delete = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the disableAnonimUpload property.
|
||||
*
|
||||
*/
|
||||
public boolean isDisableAnonimUpload() {
|
||||
return disableAnonimUpload;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the disableAnonimUpload property.
|
||||
*
|
||||
*/
|
||||
public void setDisableAnonimUpload(boolean value) {
|
||||
this.disableAnonimUpload = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the emailOnUpload property.
|
||||
*
|
||||
*/
|
||||
public boolean isEmailOnUpload() {
|
||||
return emailOnUpload;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the emailOnUpload property.
|
||||
*
|
||||
*/
|
||||
public void setEmailOnUpload(boolean value) {
|
||||
this.emailOnUpload = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the embed property.
|
||||
*
|
||||
*/
|
||||
public boolean isEmbed() {
|
||||
return embed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the embed property.
|
||||
*
|
||||
*/
|
||||
public void setEmbed(boolean value) {
|
||||
this.embed = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the fileProperties property.
|
||||
*
|
||||
*/
|
||||
public boolean isFileProperties() {
|
||||
return fileProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the fileProperties property.
|
||||
*
|
||||
*/
|
||||
public void setFileProperties(boolean value) {
|
||||
this.fileProperties = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the moderator property.
|
||||
*
|
||||
*/
|
||||
public boolean isModerator() {
|
||||
return moderator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the moderator property.
|
||||
*
|
||||
*/
|
||||
public void setModerator(boolean value) {
|
||||
this.moderator = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the onlyPublic property.
|
||||
*
|
||||
*/
|
||||
public boolean isOnlyPublic() {
|
||||
return onlyPublic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the onlyPublic property.
|
||||
*
|
||||
*/
|
||||
public void setOnlyPublic(boolean value) {
|
||||
this.onlyPublic = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the password property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the password property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setPassword(String value) {
|
||||
this.password = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the publicSearch property.
|
||||
*
|
||||
*/
|
||||
public boolean isPublicSearch() {
|
||||
return publicSearch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the publicSearch property.
|
||||
*
|
||||
*/
|
||||
public void setPublicSearch(boolean value) {
|
||||
this.publicSearch = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the search property.
|
||||
*
|
||||
*/
|
||||
public boolean isSearch() {
|
||||
return search;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the search property.
|
||||
*
|
||||
*/
|
||||
public void setSearch(boolean value) {
|
||||
this.search = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the shared property.
|
||||
*
|
||||
*/
|
||||
public boolean isShared() {
|
||||
return shared;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the shared property.
|
||||
*
|
||||
*/
|
||||
public void setShared(boolean value) {
|
||||
this.shared = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the subdomainAllowed property.
|
||||
*
|
||||
*/
|
||||
public boolean isSubdomainAllowed() {
|
||||
return subdomainAllowed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the subdomainAllowed property.
|
||||
*
|
||||
*/
|
||||
public void setSubdomainAllowed(boolean value) {
|
||||
this.subdomainAllowed = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the subdomainName property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getSubdomainName() {
|
||||
return subdomainName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the subdomainName property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setSubdomainName(String value) {
|
||||
this.subdomainName = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the thumbNailOn property.
|
||||
*
|
||||
*/
|
||||
public boolean isThumbNailOn() {
|
||||
return thumbNailOn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the thumbNailOn property.
|
||||
*
|
||||
*/
|
||||
public void setThumbNailOn(boolean value) {
|
||||
this.thumbNailOn = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the updateFiles property.
|
||||
*
|
||||
*/
|
||||
public boolean isUpdateFiles() {
|
||||
return updateFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the updateFiles property.
|
||||
*
|
||||
*/
|
||||
public void setUpdateFiles(boolean value) {
|
||||
this.updateFiles = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the upload property.
|
||||
*
|
||||
*/
|
||||
public boolean isUpload() {
|
||||
return upload;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the upload property.
|
||||
*
|
||||
*/
|
||||
public void setUpload(boolean value) {
|
||||
this.upload = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the viewModeDetails property.
|
||||
*
|
||||
*/
|
||||
public boolean isViewModeDetails() {
|
||||
return viewModeDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the viewModeDetails property.
|
||||
*
|
||||
*/
|
||||
public void setViewModeDetails(boolean value) {
|
||||
this.viewModeDetails = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the viewSubfolders property.
|
||||
*
|
||||
*/
|
||||
public boolean isViewSubfolders() {
|
||||
return viewSubfolders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the viewSubfolders property.
|
||||
*
|
||||
*/
|
||||
public void setViewSubfolders(boolean value) {
|
||||
this.viewSubfolders = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the webGrab property.
|
||||
*
|
||||
*/
|
||||
public boolean isWebGrab() {
|
||||
return webGrab;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the webGrab property.
|
||||
*
|
||||
*/
|
||||
public void setWebGrab(boolean value) {
|
||||
this.webGrab = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for sharedFolderPropertiesArray complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="sharedFolderPropertiesArray">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="item" type="{http://api.soap.shared.pmstation.com/}sharedFolderProperties" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "sharedFolderPropertiesArray", propOrder = {
|
||||
"item"
|
||||
})
|
||||
public class SharedFolderPropertiesArray {
|
||||
|
||||
@XmlElement(nillable = true)
|
||||
protected List<SharedFolderProperties> item;
|
||||
|
||||
/**
|
||||
* Gets the value of the item property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the item property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getItem().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link SharedFolderProperties }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<SharedFolderProperties> getItem() {
|
||||
if (item == null) {
|
||||
item = new ArrayList<SharedFolderProperties>();
|
||||
}
|
||||
return this.item;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for stringArray complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="stringArray">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="item" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "stringArray", namespace = "http://jaxb.dev.java.net/array", propOrder = {
|
||||
"item"
|
||||
})
|
||||
public class StringArray {
|
||||
|
||||
@XmlElement(nillable = true)
|
||||
protected List<String> item;
|
||||
|
||||
/**
|
||||
* Gets the value of the item property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the item property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getItem().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link String }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<String> getItem() {
|
||||
if (item == null) {
|
||||
item = new ArrayList<String>();
|
||||
}
|
||||
return this.item;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for userSetting complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="userSetting">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="editable" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="id" type="{http://www.w3.org/2001/XMLSchema}int"/>
|
||||
* <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="possibleValues" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* <element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "userSetting", propOrder = {
|
||||
"editable",
|
||||
"id",
|
||||
"name",
|
||||
"possibleValues",
|
||||
"title",
|
||||
"type",
|
||||
"value"
|
||||
})
|
||||
public class UserSetting {
|
||||
|
||||
protected boolean editable;
|
||||
protected int id;
|
||||
protected String name;
|
||||
@XmlElement(nillable = true)
|
||||
protected List<String> possibleValues;
|
||||
protected String title;
|
||||
protected String type;
|
||||
protected String value;
|
||||
|
||||
/**
|
||||
* Gets the value of the editable property.
|
||||
*
|
||||
*/
|
||||
public boolean isEditable() {
|
||||
return editable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the editable property.
|
||||
*
|
||||
*/
|
||||
public void setEditable(boolean value) {
|
||||
this.editable = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the id property.
|
||||
*
|
||||
*/
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the id property.
|
||||
*
|
||||
*/
|
||||
public void setId(int value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the name property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the name property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setName(String value) {
|
||||
this.name = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the possibleValues property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the possibleValues property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getPossibleValues().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link String }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<String> getPossibleValues() {
|
||||
if (possibleValues == null) {
|
||||
possibleValues = new ArrayList<String>();
|
||||
}
|
||||
return this.possibleValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the title property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the title property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setTitle(String value) {
|
||||
this.title = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the type property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the type property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setType(String value) {
|
||||
this.type = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the value property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the value property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for userSettings complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="userSettings">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="settings" type="{http://api.soap.shared.pmstation.com/}userSetting" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* <element name="settingsGroup" type="{http://api.soap.shared.pmstation.com/}settingsGroup" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "userSettings", propOrder = {
|
||||
"settings",
|
||||
"settingsGroup"
|
||||
})
|
||||
public class UserSettings {
|
||||
|
||||
@XmlElement(nillable = true)
|
||||
protected List<UserSetting> settings;
|
||||
protected SettingsGroup settingsGroup;
|
||||
|
||||
/**
|
||||
* Gets the value of the settings property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the settings property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getSettings().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link UserSetting }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<UserSetting> getSettings() {
|
||||
if (settings == null) {
|
||||
settings = new ArrayList<UserSetting>();
|
||||
}
|
||||
return this.settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the settingsGroup property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link SettingsGroup }
|
||||
*
|
||||
*/
|
||||
public SettingsGroup getSettingsGroup() {
|
||||
return settingsGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the settingsGroup property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link SettingsGroup }
|
||||
*
|
||||
*/
|
||||
public void setSettingsGroup(SettingsGroup value) {
|
||||
this.settingsGroup = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
package com.pmstation.shared.soap.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for userSettingsArray complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="userSettingsArray">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="item" type="{http://api.soap.shared.pmstation.com/}userSettings" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "userSettingsArray", propOrder = {
|
||||
"item"
|
||||
})
|
||||
public class UserSettingsArray {
|
||||
|
||||
@XmlElement(nillable = true)
|
||||
protected List<UserSettings> item;
|
||||
|
||||
/**
|
||||
* Gets the value of the item property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the item property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getItem().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link UserSettings }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<UserSettings> getItem() {
|
||||
if (item == null) {
|
||||
item = new ArrayList<UserSettings>();
|
||||
}
|
||||
return this.item;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
@javax.xml.bind.annotation.XmlSchema(namespace = "http://api.soap.shared.pmstation.com/")
|
||||
package com.pmstation.shared.soap.client;
|
||||
@@ -0,0 +1,328 @@
|
||||
/*
|
||||
* 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 com.rogiel.httpchannel.service.fourshared;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import com.pmstation.shared.soap.client.ApiException;
|
||||
import com.pmstation.shared.soap.client.DesktopAppJax2;
|
||||
import com.pmstation.shared.soap.client.DesktopAppJax2Service;
|
||||
import com.rogiel.httpchannel.service.AbstractAccountDetails;
|
||||
import com.rogiel.httpchannel.service.AbstractAuthenticator;
|
||||
import com.rogiel.httpchannel.service.AbstractHttpService;
|
||||
import com.rogiel.httpchannel.service.AbstractUploader;
|
||||
import com.rogiel.httpchannel.service.AccountDetails;
|
||||
import com.rogiel.httpchannel.service.AccountDetails.DiskQuotaAccountDetails;
|
||||
import com.rogiel.httpchannel.service.AccountDetails.FilesizeLimitAccountDetails;
|
||||
import com.rogiel.httpchannel.service.AccountDetails.PremiumAccountDetails;
|
||||
import com.rogiel.httpchannel.service.AuthenticationService;
|
||||
import com.rogiel.httpchannel.service.Authenticator;
|
||||
import com.rogiel.httpchannel.service.AuthenticatorCapability;
|
||||
import com.rogiel.httpchannel.service.CapabilityMatrix;
|
||||
import com.rogiel.httpchannel.service.Credential;
|
||||
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.NullAuthenticatorConfiguration;
|
||||
import com.rogiel.httpchannel.service.config.NullUploaderConfiguration;
|
||||
import com.rogiel.httpchannel.service.exception.AuthenticationInvalidCredentialException;
|
||||
import com.rogiel.httpchannel.service.exception.ChannelServiceException;
|
||||
import com.rogiel.httpchannel.service.exception.DownloadLinkNotFoundException;
|
||||
import com.rogiel.httpchannel.util.html.Page;
|
||||
|
||||
/**
|
||||
* This service handles uploads to 4shared.com.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com/">Rogiel</a>
|
||||
* @since 1.0
|
||||
*/
|
||||
public class FourSharedService extends AbstractHttpService implements Service,
|
||||
UploadService<NullUploaderConfiguration>,
|
||||
AuthenticationService<NullAuthenticatorConfiguration> {
|
||||
/**
|
||||
* This service ID
|
||||
*/
|
||||
public static final ServiceID SERVICE_ID = ServiceID.create("4shared");
|
||||
|
||||
private final DesktopAppJax2 api = new DesktopAppJax2Service()
|
||||
.getDesktopAppJax2Port();
|
||||
|
||||
@Override
|
||||
public ServiceID getServiceID() {
|
||||
return SERVICE_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMajorVersion() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinorVersion() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CapabilityMatrix<ServiceMode> getPossibleServiceModes() {
|
||||
return new CapabilityMatrix<ServiceMode>(ServiceMode.UNAUTHENTICATED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uploader<NullUploaderConfiguration> getUploader(String filename,
|
||||
long filesize, NullUploaderConfiguration configuration) {
|
||||
return new UploaderImpl(filename, filesize, configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uploader<NullUploaderConfiguration> getUploader(String filename,
|
||||
long filesize) {
|
||||
return getUploader(filename, filesize, newUploaderConfiguration());
|
||||
}
|
||||
|
||||
@Override
|
||||
public NullUploaderConfiguration newUploaderConfiguration() {
|
||||
// no configuration
|
||||
return NullUploaderConfiguration.SHARED_INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaximumFilesize() {
|
||||
final long max = account.as(FilesizeLimitAccountDetails.class)
|
||||
.getMaximumFilesize();
|
||||
if(max <= -1)
|
||||
return -1;
|
||||
final long free = account.as(DiskQuotaAccountDetails.class)
|
||||
.getFreeDiskSpace();
|
||||
if (max < free)
|
||||
return max;
|
||||
else
|
||||
return free;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getSupportedExtensions() {
|
||||
// no extension restriction
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CapabilityMatrix<UploaderCapability> getUploadCapabilities() {
|
||||
return new CapabilityMatrix<UploaderCapability>(
|
||||
UploaderCapability.NON_PREMIUM_ACCOUNT_UPLOAD,
|
||||
UploaderCapability.PREMIUM_ACCOUNT_UPLOAD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Authenticator<NullAuthenticatorConfiguration> getAuthenticator(
|
||||
Credential credential, NullAuthenticatorConfiguration configuration) {
|
||||
return new AuthenticatorImpl(credential, configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Authenticator<NullAuthenticatorConfiguration> getAuthenticator(
|
||||
Credential credential) {
|
||||
return getAuthenticator(credential, newAuthenticatorConfiguration());
|
||||
}
|
||||
|
||||
@Override
|
||||
public NullAuthenticatorConfiguration newAuthenticatorConfiguration() {
|
||||
return NullAuthenticatorConfiguration.SHARED_INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CapabilityMatrix<AuthenticatorCapability> getAuthenticationCapability() {
|
||||
return new CapabilityMatrix<AuthenticatorCapability>(
|
||||
AuthenticatorCapability.ACCOUNT_DETAILS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountDetails getAccountDetails() {
|
||||
return account;
|
||||
}
|
||||
|
||||
private class UploaderImpl extends
|
||||
AbstractUploader<NullUploaderConfiguration> implements
|
||||
Uploader<NullUploaderConfiguration>,
|
||||
LinkedUploadChannelCloseCallback {
|
||||
private Future<Page> uploadFuture;
|
||||
|
||||
public UploaderImpl(String filename, long filesize,
|
||||
NullUploaderConfiguration configuration) {
|
||||
super(FourSharedService.this, filename, filesize, configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UploadChannel openChannel() throws IOException {
|
||||
try {
|
||||
logger.debug("Starting upload to 4shared.com");
|
||||
final String sessionID = api.createUploadSessionKey(
|
||||
account.getUsername(), getPassword(), -1);
|
||||
logger.debug("SessionID: {}", sessionID);
|
||||
if (sessionID == null || sessionID.length() == 0)
|
||||
throw new ChannelServiceException("SessionID is invalid");
|
||||
|
||||
final long datacenterID = api.getNewFileDataCenter(
|
||||
account.getUsername(), getPassword());
|
||||
logger.debug("DatacenterID: {}", datacenterID);
|
||||
if (datacenterID <= 0)
|
||||
throw new ChannelServiceException("DatacenterID is invalid");
|
||||
|
||||
final String uri = api.getUploadFormUrl((int) datacenterID,
|
||||
sessionID);
|
||||
logger.debug("Upload URI: {}", uri);
|
||||
|
||||
// create a new channel
|
||||
final LinkedUploadChannel channel = createLinkedChannel(this);
|
||||
uploadFuture = multipartPost(uri)
|
||||
.parameter("FilePart", channel).asPageAsync();
|
||||
|
||||
// wait for channel link
|
||||
return waitChannelLink(channel);
|
||||
} catch (ApiException e) {
|
||||
throw new ChannelServiceException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String finish() throws IOException {
|
||||
try {
|
||||
final long linkID = uploadFuture.get()
|
||||
.inputByID("uploadedFileId").asLong();
|
||||
return api.getFileDownloadLink(account.getUsername(),
|
||||
getPassword(), linkID);
|
||||
} catch (InterruptedException e) {
|
||||
return null;
|
||||
} catch (ExecutionException e) {
|
||||
throw (IOException) e.getCause();
|
||||
} catch (ApiException e) {
|
||||
throw new DownloadLinkNotFoundException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class AuthenticatorImpl extends
|
||||
AbstractAuthenticator<NullAuthenticatorConfiguration> implements
|
||||
Authenticator<NullAuthenticatorConfiguration> {
|
||||
public AuthenticatorImpl(Credential credential,
|
||||
NullAuthenticatorConfiguration configuration) {
|
||||
super(credential, configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountDetails login() throws IOException {
|
||||
logger.debug("Logging to 4shared.com");
|
||||
|
||||
final String response = api.login(credential.getUsername(),
|
||||
credential.getPassword());
|
||||
|
||||
if (!response.isEmpty())
|
||||
throw new AuthenticationInvalidCredentialException();
|
||||
return (account = new AccountDetailsImpl(credential.getUsername(),
|
||||
credential.getPassword()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void logout() throws IOException {
|
||||
account = null;
|
||||
}
|
||||
}
|
||||
|
||||
private class AccountDetailsImpl extends AbstractAccountDetails implements
|
||||
PremiumAccountDetails, DiskQuotaAccountDetails,
|
||||
FilesizeLimitAccountDetails {
|
||||
private final String password;
|
||||
|
||||
private AccountDetailsImpl(String username, String password) {
|
||||
super(FourSharedService.this, username);
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
try {
|
||||
return api.isAccountActive(username, password);
|
||||
} catch (ApiException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPremium() {
|
||||
try {
|
||||
return api.isAccountPremium(username, password);
|
||||
} catch (ApiException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getFreeDiskSpace() {
|
||||
try {
|
||||
return api.getFreeSpace(username, password);
|
||||
} catch (ApiException e) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getUsedDiskSpace() {
|
||||
return getMaximumDiskSpace() - getFreeDiskSpace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaximumDiskSpace() {
|
||||
try {
|
||||
return api.getSpaceLimit(username, password);
|
||||
} catch (ApiException e) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaximumFilesize() {
|
||||
try {
|
||||
return api.getMaxFileSize(username, password);
|
||||
} catch (ApiException e) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getPassword() {
|
||||
if (account == null) {
|
||||
return null;
|
||||
} else {
|
||||
return ((AccountDetailsImpl) account).password;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.getClass().getSimpleName() + " " + getMajorVersion() + "."
|
||||
+ getMinorVersion();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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 com.rogiel.httpchannel.service.fourshared;
|
||||
|
||||
import com.rogiel.httpchannel.service.AbstractUploaderConfiguration;
|
||||
import com.rogiel.httpchannel.service.Uploader.DescriptionableUploaderConfiguration;
|
||||
import com.rogiel.httpchannel.service.Uploader.UploaderConfiguration;
|
||||
|
||||
/**
|
||||
* Describes an configuration for an {@link UploaderImpl}
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class FourSharedUploaderConfiguration extends
|
||||
AbstractUploaderConfiguration implements UploaderConfiguration,
|
||||
DescriptionableUploaderConfiguration {
|
||||
/**
|
||||
* The upload description
|
||||
*/
|
||||
private String description = DescriptionableUploaderConfiguration.DEFAULT_DESCRIPTION;
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FourSharedUploaderConfiguration description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
com.rogiel.httpchannel.service.fourshared.FourSharedService
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.rogiel.httpchannel.service.fourshared;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Properties;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.rogiel.httpchannel.service.fourshared.FourSharedService;
|
||||
import com.rogiel.httpchannel.service.helper.AuthenticationServices;
|
||||
import com.rogiel.httpchannel.util.ChannelUtils;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class FourSharedServiceTest {
|
||||
private final FourSharedService service = new FourSharedService();
|
||||
private final Properties properties = new Properties();
|
||||
|
||||
@Before
|
||||
public void setUp() throws IOException {
|
||||
properties.load(Files.newInputStream(Paths
|
||||
.get("../src/test/resources/login.properties")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpload() throws IOException {
|
||||
AuthenticationServices.authenticator(service,
|
||||
properties.getProperty("4shared.username"),
|
||||
properties.getProperty("4shared.password")).login();
|
||||
|
||||
final Path path = Paths
|
||||
.get("../src/test/resources/upload-test-file.txt");
|
||||
final URI uri = ChannelUtils.upload(service, path);
|
||||
|
||||
Assert.assertNotNull(uri);
|
||||
System.out.println(uri);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,14 @@
|
||||
<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-depositfiles</artifactId>
|
||||
<groupId>com.rogiel.httpchannel.services</groupId>
|
||||
<name>HttpChannel/Service/DepositFiles</name>
|
||||
<description>Provides upload access to depositfiles.com</description>
|
||||
<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.1-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>httpchannel-service-depositfiles</artifactId>
|
||||
<groupId>com.rogiel.httpchannel.services</groupId>
|
||||
<name>HttpChannel/Service/DepositFiles</name>
|
||||
<description>Provides upload access to depositfiles.com</description>
|
||||
</project>
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package com.rogiel.httpchannel.service.impl;
|
||||
package com.rogiel.httpchannel.service.depositfiles;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
@@ -26,9 +26,11 @@ import java.util.regex.Pattern;
|
||||
import com.rogiel.httpchannel.captcha.ImageCaptcha;
|
||||
import com.rogiel.httpchannel.captcha.ReCaptchaExtractor;
|
||||
import com.rogiel.httpchannel.captcha.exception.UnsolvableCaptchaServiceException;
|
||||
import com.rogiel.httpchannel.service.AbstractAccountDetails;
|
||||
import com.rogiel.httpchannel.service.AbstractAuthenticator;
|
||||
import com.rogiel.httpchannel.service.AbstractHttpService;
|
||||
import com.rogiel.httpchannel.service.AbstractUploader;
|
||||
import com.rogiel.httpchannel.service.AccountDetails;
|
||||
import com.rogiel.httpchannel.service.AuthenticationService;
|
||||
import com.rogiel.httpchannel.service.Authenticator;
|
||||
import com.rogiel.httpchannel.service.AuthenticatorCapability;
|
||||
@@ -46,7 +48,7 @@ import com.rogiel.httpchannel.service.channel.LinkedUploadChannel.LinkedUploadCh
|
||||
import com.rogiel.httpchannel.service.config.NullAuthenticatorConfiguration;
|
||||
import com.rogiel.httpchannel.service.config.NullUploaderConfiguration;
|
||||
import com.rogiel.httpchannel.service.exception.AuthenticationInvalidCredentialException;
|
||||
import com.rogiel.httpchannel.util.htmlparser.HTMLPage;
|
||||
import com.rogiel.httpchannel.util.html.Page;
|
||||
|
||||
/**
|
||||
* This service handles uploads to UploadKing.com.
|
||||
@@ -145,14 +147,20 @@ public class DepositFilesService extends AbstractHttpService implements
|
||||
|
||||
@Override
|
||||
public CapabilityMatrix<AuthenticatorCapability> getAuthenticationCapability() {
|
||||
return new CapabilityMatrix<AuthenticatorCapability>();
|
||||
return new CapabilityMatrix<AuthenticatorCapability>(
|
||||
AuthenticatorCapability.ACCOUNT_DETAILS);
|
||||
}
|
||||
|
||||
protected class UploaderImpl extends
|
||||
@Override
|
||||
public AccountDetails getAccountDetails() {
|
||||
return account;
|
||||
}
|
||||
|
||||
private class UploaderImpl extends
|
||||
AbstractUploader<NullUploaderConfiguration> implements
|
||||
Uploader<NullUploaderConfiguration>,
|
||||
LinkedUploadChannelCloseCallback {
|
||||
private Future<HTMLPage> uploadFuture;
|
||||
private Future<Page> uploadFuture;
|
||||
|
||||
public UploaderImpl(String filename, long filesize,
|
||||
NullUploaderConfiguration configuration) {
|
||||
@@ -162,11 +170,13 @@ public class DepositFilesService extends AbstractHttpService implements
|
||||
@Override
|
||||
public UploadChannel openChannel() throws IOException {
|
||||
logger.debug("Starting upload to depositfiles.com");
|
||||
final HTMLPage page = get("http://www.depositfiles.com/").asPage();
|
||||
final Page page = get("http://www.depositfiles.com/").asPage();
|
||||
|
||||
final String uri = page.findFormAction(UPLOAD_URI_PATTERN);
|
||||
final String uploadID = page.getInputValue("UPLOAD_IDENTIFIER");
|
||||
final String maxFileSize = page.getInputValue("MAX_FILE_SIZE");
|
||||
final String uri = page.form(UPLOAD_URI_PATTERN).asString();
|
||||
final String uploadID = page.inputByName("UPLOAD_IDENTIFIER")
|
||||
.asString();
|
||||
final String maxFileSize = page.formByName("MAX_FILE_SIZE")
|
||||
.asString();
|
||||
|
||||
logger.debug("Upload URI: {}, ID: {}", uri, uploadID);
|
||||
|
||||
@@ -176,14 +186,14 @@ public class DepositFilesService extends AbstractHttpService implements
|
||||
.parameter("UPLOAD_IDENTIFIER", uploadID)
|
||||
.parameter("agree", true)
|
||||
.parameter("MAX_FILE_SIZE", maxFileSize).asPageAsync();
|
||||
return waitChannelLink(channel, uploadFuture);
|
||||
return waitChannelLink(channel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String finish() throws IOException {
|
||||
try {
|
||||
final String link = uploadFuture.get().findScript(
|
||||
DOWNLOAD_URI_PATTERN, 0);
|
||||
final String link = uploadFuture.get()
|
||||
.script(DOWNLOAD_URI_PATTERN).asString();
|
||||
if (link == null)
|
||||
return null;
|
||||
return link;
|
||||
@@ -195,7 +205,7 @@ public class DepositFilesService extends AbstractHttpService implements
|
||||
}
|
||||
}
|
||||
|
||||
protected class AuthenticatorImpl extends
|
||||
private class AuthenticatorImpl extends
|
||||
AbstractAuthenticator<NullAuthenticatorConfiguration> implements
|
||||
Authenticator<NullAuthenticatorConfiguration> {
|
||||
public AuthenticatorImpl(Credential credential,
|
||||
@@ -204,9 +214,9 @@ public class DepositFilesService extends AbstractHttpService implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void login() throws IOException {
|
||||
public AccountDetails login() throws IOException {
|
||||
logger.debug("Authenticating into depositfiles.com");
|
||||
HTMLPage page = post("http://depositfiles.com/login.php?return=%2F")
|
||||
Page page = post("http://depositfiles.com/login.php?return=%2F")
|
||||
.parameter("go", true)
|
||||
.parameter("login", credential.getUsername())
|
||||
.parameter("password", credential.getPassword()).asPage();
|
||||
@@ -232,10 +242,10 @@ public class DepositFilesService extends AbstractHttpService implements
|
||||
throw new UnsolvableCaptchaServiceException();
|
||||
} else {
|
||||
captchaService.valid(captcha);
|
||||
if (!page.contains(VALID_LOGIN_REDIRECT))
|
||||
if (!page.search(VALID_LOGIN_REDIRECT).hasResults())
|
||||
throw new AuthenticationInvalidCredentialException();
|
||||
serviceMode = ServiceMode.NON_PREMIUM;
|
||||
return;
|
||||
return (account = new AccountDetailsImpl(
|
||||
credential.getUsername()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,4 +256,14 @@ public class DepositFilesService extends AbstractHttpService implements
|
||||
// TODO check logout status
|
||||
}
|
||||
}
|
||||
|
||||
private class AccountDetailsImpl extends AbstractAccountDetails {
|
||||
/**
|
||||
* @param username
|
||||
* the account username
|
||||
*/
|
||||
public AccountDetailsImpl(String username) {
|
||||
super(DepositFilesService.this, username);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
com.rogiel.httpchannel.service.impl.DepositFilesService
|
||||
com.rogiel.httpchannel.service.depositfiles.DepositFilesService
|
||||
@@ -31,6 +31,7 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.rogiel.httpchannel.service.UploaderCapability;
|
||||
import com.rogiel.httpchannel.service.depositfiles.DepositFilesService;
|
||||
import com.rogiel.httpchannel.util.ChannelUtils;
|
||||
|
||||
public class DepositFilesServiceTest {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>httpchannel-service</artifactId>
|
||||
<groupId>com.rogiel.httpchannel</groupId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>httpchannel-service-filesonic</artifactId>
|
||||
|
||||
@@ -16,28 +16,31 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package com.rogiel.httpchannel.filesonic;
|
||||
package com.rogiel.httpchannel.service.filesonic;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
|
||||
import javax.xml.bind.JAXB;
|
||||
|
||||
import com.rogiel.httpchannel.filesonic.xml.FSAPI;
|
||||
import com.rogiel.httpchannel.filesonic.xml.FSGetUploadURL;
|
||||
import com.rogiel.httpchannel.filesonic.xml.FSUpload;
|
||||
import com.rogiel.httpchannel.http.HttpContext;
|
||||
import com.rogiel.httpchannel.service.filesonic.xml.FSAPI;
|
||||
import com.rogiel.httpchannel.service.filesonic.xml.FSGetUploadURL;
|
||||
import com.rogiel.httpchannel.service.filesonic.xml.FSUpload;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class FileSonicAPI {
|
||||
private static final String BASE_URI = "http://api.filesonic.com/";
|
||||
|
||||
private final HttpContext ctx;
|
||||
|
||||
private String email;
|
||||
private String password;
|
||||
|
||||
public Object getInfo(int id) {
|
||||
return id;
|
||||
|
||||
public FileSonicAPI(HttpContext ctx) {
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
public URI getUploadURI() throws IOException {
|
||||
@@ -66,6 +69,6 @@ public class FileSonicAPI {
|
||||
throws IOException {
|
||||
final URI uri = URI.create(BASE_URI + requestURI + "&u=" + email
|
||||
+ "&p=" + password + "&format=xml");
|
||||
return JAXB.unmarshal(uri.toURL().openStream(), type);
|
||||
return JAXB.unmarshal(ctx.get(uri).asStream(), type);
|
||||
}
|
||||
}
|
||||
@@ -16,17 +16,18 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package com.rogiel.httpchannel.service.impl;
|
||||
package com.rogiel.httpchannel.service.filesonic;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.rogiel.httpchannel.filesonic.FileSonicAPI;
|
||||
import com.rogiel.httpchannel.service.AbstractAccountDetails;
|
||||
import com.rogiel.httpchannel.service.AbstractAuthenticator;
|
||||
import com.rogiel.httpchannel.service.AbstractHttpService;
|
||||
import com.rogiel.httpchannel.service.AbstractUploader;
|
||||
import com.rogiel.httpchannel.service.AccountDetails;
|
||||
import com.rogiel.httpchannel.service.AuthenticationService;
|
||||
import com.rogiel.httpchannel.service.Authenticator;
|
||||
import com.rogiel.httpchannel.service.AuthenticatorCapability;
|
||||
@@ -39,6 +40,7 @@ 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.AccountDetails.PremiumAccountDetails;
|
||||
import com.rogiel.httpchannel.service.channel.LinkedUploadChannel;
|
||||
import com.rogiel.httpchannel.service.channel.LinkedUploadChannel.LinkedUploadChannelCloseCallback;
|
||||
import com.rogiel.httpchannel.service.config.NullAuthenticatorConfiguration;
|
||||
@@ -57,17 +59,17 @@ public class FileSonicService extends AbstractHttpService implements Service,
|
||||
/**
|
||||
* This service ID
|
||||
*/
|
||||
public static final ServiceID SERVICE_ID = ServiceID.create("megaupload");
|
||||
public static final ServiceID SERVICE_ID = ServiceID.create("filesonic");
|
||||
|
||||
/**
|
||||
* The download URI pattern
|
||||
*/
|
||||
private static final Pattern DOWNLOAD_URI_PATTERN = Pattern
|
||||
.compile("http://www.filesonic.com/file/[0-9A-z]*");
|
||||
.compile("http://www\\.filesonic\\.com/file/[0-9A-z]*");
|
||||
/**
|
||||
* The FileSonic API
|
||||
*/
|
||||
private final FileSonicAPI api = new FileSonicAPI();
|
||||
private final FileSonicAPI api = new FileSonicAPI(http);
|
||||
|
||||
@Override
|
||||
public ServiceID getServiceID() {
|
||||
@@ -147,10 +149,15 @@ public class FileSonicService extends AbstractHttpService implements Service,
|
||||
|
||||
@Override
|
||||
public CapabilityMatrix<AuthenticatorCapability> getAuthenticationCapability() {
|
||||
return new CapabilityMatrix<AuthenticatorCapability>();
|
||||
return new CapabilityMatrix<AuthenticatorCapability>(AuthenticatorCapability.ACCOUNT_DETAILS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountDetails getAccountDetails() {
|
||||
return account;
|
||||
}
|
||||
|
||||
protected class UploaderImpl extends
|
||||
private class UploaderImpl extends
|
||||
AbstractUploader<NullUploaderConfiguration> implements
|
||||
Uploader<NullUploaderConfiguration>,
|
||||
LinkedUploadChannelCloseCallback {
|
||||
@@ -167,7 +174,7 @@ public class FileSonicService extends AbstractHttpService implements Service,
|
||||
final LinkedUploadChannel channel = createLinkedChannel(this);
|
||||
uploadFuture = multipartPost(api.getUploadURI().toString())
|
||||
.parameter("files[]", channel).asStringAsync();
|
||||
return waitChannelLink(channel, uploadFuture);
|
||||
return waitChannelLink(channel);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -183,7 +190,7 @@ public class FileSonicService extends AbstractHttpService implements Service,
|
||||
}
|
||||
}
|
||||
|
||||
protected class AuthenticatorImpl extends
|
||||
private class AuthenticatorImpl extends
|
||||
AbstractAuthenticator<NullAuthenticatorConfiguration> implements
|
||||
Authenticator<NullAuthenticatorConfiguration> {
|
||||
public AuthenticatorImpl(Credential credential,
|
||||
@@ -192,19 +199,31 @@ public class FileSonicService extends AbstractHttpService implements Service,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void login() throws IOException {
|
||||
public AccountDetails login() throws IOException {
|
||||
logger.debug("Logging to filesonic.com");
|
||||
api.login(credential.getUsername(), credential.getPassword());
|
||||
serviceMode = ServiceMode.NON_PREMIUM;
|
||||
// if (username == null)
|
||||
// throw new AuthenticationInvalidCredentialException();
|
||||
return (account = new AccountDetailsImpl(credential.getUsername()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void logout() throws IOException {
|
||||
post("http://www.megaupload.com/?c=account").parameter("logout",
|
||||
true).request();
|
||||
// TODO check logout status
|
||||
api.logout();
|
||||
}
|
||||
}
|
||||
|
||||
private class AccountDetailsImpl extends AbstractAccountDetails implements PremiumAccountDetails {
|
||||
/**
|
||||
* @param username
|
||||
* the username
|
||||
*/
|
||||
public AccountDetailsImpl(String username) {
|
||||
super(FileSonicService.this, username);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPremium() {
|
||||
//TODO implement this
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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 com.rogiel.httpchannel.service.filesonic.xml;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class FSAPI {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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 com.rogiel.httpchannel.service.filesonic.xml;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
@XmlRootElement(name = "getUploadUrl")
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class FSGetUploadURL extends FSResponse {
|
||||
@XmlElement(name = "response")
|
||||
private FSGetUploadURLResponse response;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public static class FSGetUploadURLResponse {
|
||||
@XmlElement(name = "url")
|
||||
private String uploadURI;
|
||||
@XmlElement(name = "max-filesize")
|
||||
private long maxFilesize;
|
||||
|
||||
public String getUploadURI() {
|
||||
return uploadURI;
|
||||
}
|
||||
|
||||
public long getMaxFilesize() {
|
||||
return maxFilesize;
|
||||
}
|
||||
}
|
||||
|
||||
public FSGetUploadURLResponse getResponse() {
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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 com.rogiel.httpchannel.service.filesonic.xml;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public abstract class FSResponse {
|
||||
@XmlElement(name = "status")
|
||||
private String status;
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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 com.rogiel.httpchannel.service.filesonic.xml;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElements;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@XmlRootElement(name = "FSApi_Upload")
|
||||
public class FSUpload extends FSAPI {
|
||||
@XmlElements(value = { @XmlElement(name = "getUploadUrl", type = FSGetUploadURL.class) })
|
||||
private FSResponse response;
|
||||
|
||||
public FSResponse getResponse() {
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
com.rogiel.httpchannel.service.impl.FileSonicService
|
||||
com.rogiel.httpchannel.service.filesonic.FileSonicService
|
||||
@@ -1,13 +1,14 @@
|
||||
<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>
|
||||
<groupId>com.rogiel.httpchannel.services</groupId>
|
||||
<name>HttpChannel/Service/HotFile</name>
|
||||
<description>Provides download and upload access to hotfile.com</description>
|
||||
<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.1-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>httpchannel-service-hotfile</artifactId>
|
||||
<groupId>com.rogiel.httpchannel.services</groupId>
|
||||
<name>HttpChannel/Service/HotFile</name>
|
||||
<description>Provides download and upload access to hotfile.com</description>
|
||||
</project>
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package com.rogiel.httpchannel.service.impl;
|
||||
package com.rogiel.httpchannel.service.hotfile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
@@ -25,12 +25,16 @@ import java.util.concurrent.Future;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.htmlparser.Tag;
|
||||
|
||||
import com.rogiel.httpchannel.service.AbstractAccountDetails;
|
||||
import com.rogiel.httpchannel.service.AbstractAuthenticator;
|
||||
import com.rogiel.httpchannel.service.AbstractHttpDownloader;
|
||||
import com.rogiel.httpchannel.service.AbstractHttpService;
|
||||
import com.rogiel.httpchannel.service.AbstractUploader;
|
||||
import com.rogiel.httpchannel.service.AccountDetails;
|
||||
import com.rogiel.httpchannel.service.AccountDetails.HotLinkingAccountDetails;
|
||||
import com.rogiel.httpchannel.service.AccountDetails.PremiumAccountDetails;
|
||||
import com.rogiel.httpchannel.service.AccountDetails.ReferralAccountDetails;
|
||||
import com.rogiel.httpchannel.service.AuthenticationService;
|
||||
import com.rogiel.httpchannel.service.Authenticator;
|
||||
import com.rogiel.httpchannel.service.AuthenticatorCapability;
|
||||
@@ -54,7 +58,9 @@ import com.rogiel.httpchannel.service.config.NullAuthenticatorConfiguration;
|
||||
import com.rogiel.httpchannel.service.config.NullDownloaderConfiguration;
|
||||
import com.rogiel.httpchannel.service.config.NullUploaderConfiguration;
|
||||
import com.rogiel.httpchannel.service.exception.AuthenticationInvalidCredentialException;
|
||||
import com.rogiel.httpchannel.util.htmlparser.HTMLPage;
|
||||
import com.rogiel.httpchannel.util.Filesizes;
|
||||
import com.rogiel.httpchannel.util.html.Page;
|
||||
import com.rogiel.httpchannel.util.html.SearchResults;
|
||||
|
||||
/**
|
||||
* This service handles login, upload and download to HotFile.com.
|
||||
@@ -72,17 +78,31 @@ public class HotFileService extends AbstractHttpService implements Service,
|
||||
public static final ServiceID SERVICE_ID = ServiceID.create("hotfile");
|
||||
|
||||
private static final Pattern UPLOAD_URI_PATTERN = Pattern
|
||||
.compile("http://u[0-9]*\\.hotfile\\.com/upload\\.cgi\\?[0-9]*");
|
||||
.compile("http[s]?://u[0-9]+\\.hotfile\\.com/upload\\.cgi\\?[0-9]*");
|
||||
|
||||
private static final Pattern DOWNLOAD_DIRECT_LINK_PATTERN = Pattern
|
||||
.compile("http://hotfile\\.com/get/([0-9]*)/([A-Za-z0-9]*)/([A-Za-z0-9]*)/(.*)");
|
||||
.compile("http[s]?://hotfile\\.com/get/([0-9]+)/([A-Za-z0-9]+)/([A-Za-z0-9]+)/(.+)");
|
||||
// private static final Pattern DOWNLOAD_TIMER = Pattern
|
||||
// .compile("timerend=d\\.getTime\\(\\)\\+([0-9]*);");
|
||||
// private static final Pattern DOWNLOAD_FILESIZE = Pattern
|
||||
// .compile("[0-9]*(\\.[0-9]*)? (K|M|G)B");
|
||||
|
||||
private static final Pattern DOWNLOAD_URI_PATTERN = Pattern
|
||||
.compile("http://hotfile\\.com/dl/([0-9]*)/([A-Za-z0-9]*)/(.*)");
|
||||
.compile("http[s]?://hotfile\\.com/dl/([0-9]+)/([A-Za-z0-9]+)/(.+)");
|
||||
|
||||
// account
|
||||
private static final Pattern ACCOUNT_NAME_PATTERN = Pattern
|
||||
.compile("User: ([^\\|]+)");
|
||||
|
||||
private static final Pattern ACCOUNT_TYPE_PATTERN = Pattern
|
||||
.compile("Account: Free");
|
||||
|
||||
private static final Pattern HOTLINK_TRAFFIC_PATTERN = Pattern.compile(
|
||||
"Hotlink traffic left: ([0-9]+(\\.[0-9]+))(K|M|G)b",
|
||||
Pattern.CASE_INSENSITIVE);
|
||||
|
||||
private static final Pattern REFERRAL_URL_PATTERN = Pattern
|
||||
.compile("http[s]?://hotfile\\.com/register\\.html\\?reff=[0-9]+");
|
||||
|
||||
@Override
|
||||
public ServiceID getServiceID() {
|
||||
@@ -186,14 +206,20 @@ public class HotFileService extends AbstractHttpService implements Service,
|
||||
|
||||
@Override
|
||||
public CapabilityMatrix<AuthenticatorCapability> getAuthenticationCapability() {
|
||||
return new CapabilityMatrix<AuthenticatorCapability>();
|
||||
return new CapabilityMatrix<AuthenticatorCapability>(
|
||||
AuthenticatorCapability.ACCOUNT_DETAILS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountDetails getAccountDetails() {
|
||||
return account;
|
||||
}
|
||||
|
||||
protected class UploaderImpl extends
|
||||
AbstractUploader<NullUploaderConfiguration> implements
|
||||
Uploader<NullUploaderConfiguration>,
|
||||
LinkedUploadChannelCloseCallback {
|
||||
private Future<HTMLPage> uploadFuture;
|
||||
private Future<Page> uploadFuture;
|
||||
|
||||
public UploaderImpl(String filename, long filesize,
|
||||
NullUploaderConfiguration configuration) {
|
||||
@@ -203,8 +229,8 @@ public class HotFileService extends AbstractHttpService implements Service,
|
||||
@Override
|
||||
public UploadChannel openChannel() throws IOException {
|
||||
logger.debug("Starting upload to hotfile.com");
|
||||
final HTMLPage page = get("http://www.hotfile.com/").asPage();
|
||||
final String action = page.findFormAction(UPLOAD_URI_PATTERN);
|
||||
final Page page = get("http://www.hotfile.com/").asPage();
|
||||
final String action = page.form(UPLOAD_URI_PATTERN).asString();
|
||||
|
||||
logger.debug("Upload URI is {}", action);
|
||||
|
||||
@@ -212,13 +238,14 @@ public class HotFileService extends AbstractHttpService implements Service,
|
||||
|
||||
uploadFuture = multipartPost(action)
|
||||
.parameter("uploads[]", channel).asPageAsync();
|
||||
return waitChannelLink(channel, uploadFuture);
|
||||
return waitChannelLink(channel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String finish() throws IOException {
|
||||
try {
|
||||
return uploadFuture.get().getInputValue(DOWNLOAD_URI_PATTERN);
|
||||
return uploadFuture.get().input(DOWNLOAD_URI_PATTERN)
|
||||
.asString();
|
||||
} catch (InterruptedException e) {
|
||||
return null;
|
||||
} catch (ExecutionException e) {
|
||||
@@ -237,7 +264,7 @@ public class HotFileService extends AbstractHttpService implements Service,
|
||||
public DownloadChannel openChannel(DownloadListener listener,
|
||||
long position) throws IOException {
|
||||
logger.debug("Downloading {} from hotfile.com", uri);
|
||||
final HTMLPage page = get(uri).asPage();
|
||||
final Page page = get(uri).asPage();
|
||||
|
||||
// // try to find timer
|
||||
// final String stringTimer = PatternUtils.find(DOWNLOAD_TIMER,
|
||||
@@ -251,8 +278,8 @@ public class HotFileService extends AbstractHttpService implements Service,
|
||||
// + " milliseconds");
|
||||
// }
|
||||
|
||||
final String downloadUrl = page
|
||||
.findLink(DOWNLOAD_DIRECT_LINK_PATTERN);
|
||||
final String downloadUrl = page.link(DOWNLOAD_DIRECT_LINK_PATTERN)
|
||||
.asString();
|
||||
logger.debug("Download link is {}", downloadUrl);
|
||||
// final String tmHash = PatternUtils.find(DOWNLOAD_TMHASH_PATTERN,
|
||||
// content);F
|
||||
@@ -273,17 +300,35 @@ public class HotFileService extends AbstractHttpService implements Service,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void login() throws ClientProtocolException, IOException {
|
||||
public AccountDetails login() throws ClientProtocolException,
|
||||
IOException {
|
||||
logger.debug("Authenticating hotfile.com");
|
||||
HTMLPage page = post("http://www.hotfile.com/login.php")
|
||||
Page page = post("http://www.hotfile.com/login.php")
|
||||
.parameter("returnto", "/index.php")
|
||||
.parameter("user", credential.getUsername())
|
||||
.parameter("pass", credential.getPassword()).asPage();
|
||||
|
||||
final Tag accountTag = page.getTagByID("account");
|
||||
if (accountTag == null)
|
||||
page = get("http://www.hotfile.com/myreferals.html?lang=en")
|
||||
.asPage();
|
||||
|
||||
final SearchResults usernameResults = page
|
||||
.search(ACCOUNT_NAME_PATTERN);
|
||||
if (!usernameResults.hasResults())
|
||||
throw new AuthenticationInvalidCredentialException();
|
||||
serviceMode = ServiceMode.NON_PREMIUM;
|
||||
|
||||
final String username = usernameResults.asString(1);
|
||||
final String type = page.search(ACCOUNT_TYPE_PATTERN).asString();
|
||||
|
||||
final SearchResults trafficResults = page
|
||||
.search(HOTLINK_TRAFFIC_PATTERN);
|
||||
final long hotlinkTraffic = Filesizes.auto(
|
||||
trafficResults.asDouble(1), trafficResults.asString(3));
|
||||
|
||||
final String referralURL = page.search(REFERRAL_URL_PATTERN)
|
||||
.asString();
|
||||
|
||||
return (account = new AccountDetailsImpl(username, type == null,
|
||||
hotlinkTraffic, referralURL));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -294,6 +339,52 @@ public class HotFileService extends AbstractHttpService implements Service,
|
||||
}
|
||||
}
|
||||
|
||||
private class AccountDetailsImpl extends AbstractAccountDetails implements
|
||||
PremiumAccountDetails, ReferralAccountDetails,
|
||||
HotLinkingAccountDetails {
|
||||
private final boolean premium;
|
||||
private final long hotlinkTraffic;
|
||||
private final String referralURL;
|
||||
|
||||
/**
|
||||
* @param username
|
||||
* the username
|
||||
* @param premium
|
||||
* whether the account is premium
|
||||
* @param hotlinkTraffic
|
||||
* the available hotlink traffic
|
||||
* @param referralURL
|
||||
* the referral url
|
||||
*/
|
||||
public AccountDetailsImpl(String username, boolean premium,
|
||||
long hotlinkTraffic, String referralURL) {
|
||||
super(HotFileService.this, username);
|
||||
this.premium = premium;
|
||||
this.hotlinkTraffic = hotlinkTraffic;
|
||||
this.referralURL = referralURL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPremium() {
|
||||
return premium;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getHotlinkTraffic() {
|
||||
return hotlinkTraffic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMembersReferred() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReferralURL() {
|
||||
return referralURL;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.getClass().getSimpleName() + " " + getMajorVersion() + "."
|
||||
@@ -1 +1 @@
|
||||
com.rogiel.httpchannel.service.impl.HotFileService
|
||||
com.rogiel.httpchannel.service.hotfile.HotFileService
|
||||
@@ -23,6 +23,7 @@ import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.rogiel.httpchannel.service.helper.Services;
|
||||
import com.rogiel.httpchannel.service.hotfile.HotFileService;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
|
||||
@@ -47,6 +47,7 @@ import com.rogiel.httpchannel.service.UploaderCapability;
|
||||
import com.rogiel.httpchannel.service.exception.AuthenticationInvalidCredentialException;
|
||||
import com.rogiel.httpchannel.service.helper.Services;
|
||||
import com.rogiel.httpchannel.service.helper.UploadServices;
|
||||
import com.rogiel.httpchannel.service.hotfile.HotFileService;
|
||||
import com.rogiel.httpchannel.util.ChannelUtils;
|
||||
|
||||
public class HotFileServiceTest {
|
||||
@@ -75,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
|
||||
|
||||
14
httpchannel-service/httpchannel-service-ifileit/pom.xml
Normal file
14
httpchannel-service/httpchannel-service-ifileit/pom.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<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.1-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>httpchannel-service-ifileit</artifactId>
|
||||
<groupId>com.rogiel.httpchannel.services</groupId>
|
||||
<name>HttpChannel/Service/iFileIt</name>
|
||||
<description>Provides download and upload access to ifile.it</description>
|
||||
</project>
|
||||
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* 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 com.rogiel.httpchannel.service.ifile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
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.html.Page;
|
||||
|
||||
/**
|
||||
* This service handles login, upload and download to HotFile.com.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
* @since 1.0
|
||||
*/
|
||||
public class IFileService extends AbstractHttpService implements Service,
|
||||
UploadService<NullUploaderConfiguration> {
|
||||
/**
|
||||
* This service ID
|
||||
*/
|
||||
public static final ServiceID SERVICE_ID = ServiceID.create("ifileit");
|
||||
|
||||
private static final Pattern UPLOAD_URI_PATTERN = Pattern
|
||||
.compile("http://i[0-9]+\\.ifile\\.it/upload\\?response=redirect");
|
||||
|
||||
private static final Pattern DOWNLOAD_URI_PATTERN = Pattern
|
||||
.compile("http://ifile\\.it/[a-z0-9]{7}/.*");
|
||||
|
||||
@Override
|
||||
public ServiceID getServiceID() {
|
||||
return SERVICE_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMajorVersion() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinorVersion() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CapabilityMatrix<ServiceMode> getPossibleServiceModes() {
|
||||
return new CapabilityMatrix<ServiceMode>(ServiceMode.UNAUTHENTICATED,
|
||||
ServiceMode.NON_PREMIUM, ServiceMode.PREMIUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uploader<NullUploaderConfiguration> getUploader(String filename,
|
||||
long filesize, NullUploaderConfiguration configuration) {
|
||||
return new UploaderImpl(filename, filesize, configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uploader<NullUploaderConfiguration> getUploader(String filename,
|
||||
long filesize) {
|
||||
return getUploader(filename, filesize, newUploaderConfiguration());
|
||||
}
|
||||
|
||||
@Override
|
||||
public NullUploaderConfiguration newUploaderConfiguration() {
|
||||
return NullUploaderConfiguration.SHARED_INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaximumFilesize() {
|
||||
return 1 * 1024 * 1024 * 1024;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getSupportedExtensions() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CapabilityMatrix<UploaderCapability> getUploadCapabilities() {
|
||||
return new CapabilityMatrix<UploaderCapability>(
|
||||
UploaderCapability.UNAUTHENTICATED_UPLOAD);
|
||||
}
|
||||
|
||||
protected class UploaderImpl extends
|
||||
AbstractUploader<NullUploaderConfiguration> implements
|
||||
Uploader<NullUploaderConfiguration>,
|
||||
LinkedUploadChannelCloseCallback {
|
||||
private Future<Page> uploadFuture;
|
||||
|
||||
public UploaderImpl(String filename, long filesize,
|
||||
NullUploaderConfiguration configuration) {
|
||||
super(IFileService.this, filename, filesize, configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UploadChannel openChannel() throws IOException {
|
||||
logger.debug("Starting upload to ifile.it");
|
||||
final Page page = get("http://ifile.it/upload-classic.html")
|
||||
.asPage();
|
||||
final String action = page.form(UPLOAD_URI_PATTERN).asString();
|
||||
|
||||
logger.debug("Upload URI is {}", action);
|
||||
|
||||
final LinkedUploadChannel channel = createLinkedChannel(this);
|
||||
|
||||
uploadFuture = multipartPost(action).parameter("Filedata", channel)
|
||||
.asPageAsync();
|
||||
return waitChannelLink(channel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String finish() throws IOException {
|
||||
try {
|
||||
return uploadFuture.get().input(DOWNLOAD_URI_PATTERN).asString();
|
||||
} catch (InterruptedException e) {
|
||||
return null;
|
||||
} catch (ExecutionException e) {
|
||||
throw (IOException) e.getCause();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.getClass().getSimpleName() + " " + getMajorVersion() + "."
|
||||
+ getMinorVersion();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
com.rogiel.httpchannel.service.filesonic.FileSonicService
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* 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 com.rogiel.httpchannel.service.ifile;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.channels.SeekableByteChannel;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.rogiel.httpchannel.service.ServiceID;
|
||||
import com.rogiel.httpchannel.service.UploadChannel;
|
||||
import com.rogiel.httpchannel.service.helper.UploadServices;
|
||||
import com.rogiel.httpchannel.util.ChannelUtils;
|
||||
|
||||
public class IFileServiceTest {
|
||||
private IFileService service;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
service = new IFileService();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testServiceId() {
|
||||
assertEquals(ServiceID.create("hotfile"), service.getServiceID());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNonLoguedInUploader() throws IOException {
|
||||
final Path path = Paths
|
||||
.get("../src/test/resources/upload-test-file.txt");
|
||||
final UploadChannel channel = UploadServices.upload(service, path)
|
||||
.openChannel();
|
||||
final SeekableByteChannel inChannel = Files.newByteChannel(path);
|
||||
|
||||
try {
|
||||
ChannelUtils.copy(inChannel, channel);
|
||||
} finally {
|
||||
inChannel.close();
|
||||
channel.close();
|
||||
}
|
||||
|
||||
System.out.println(channel.getDownloadLink());
|
||||
Assert.assertNotNull(channel.getDownloadLink());
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>httpchannel-service</artifactId>
|
||||
<groupId>com.rogiel.httpchannel</groupId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>httpchannel-service-megaupload</artifactId>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package com.rogiel.httpchannel.service.impl;
|
||||
package com.rogiel.httpchannel.service.megaupload;
|
||||
|
||||
import com.rogiel.httpchannel.service.AbstractDownloaderConfiguration;
|
||||
import com.rogiel.httpchannel.service.Downloader.DownloaderConfiguration;
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package com.rogiel.httpchannel.service.impl;
|
||||
package com.rogiel.httpchannel.service.megaupload;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
@@ -28,10 +28,13 @@ import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
|
||||
import com.rogiel.httpchannel.service.AbstractAccountDetails;
|
||||
import com.rogiel.httpchannel.service.AbstractAuthenticator;
|
||||
import com.rogiel.httpchannel.service.AbstractHttpDownloader;
|
||||
import com.rogiel.httpchannel.service.AbstractHttpService;
|
||||
import com.rogiel.httpchannel.service.AbstractUploader;
|
||||
import com.rogiel.httpchannel.service.AccountDetails;
|
||||
import com.rogiel.httpchannel.service.AccountDetails.PremiumAccountDetails;
|
||||
import com.rogiel.httpchannel.service.AuthenticationService;
|
||||
import com.rogiel.httpchannel.service.Authenticator;
|
||||
import com.rogiel.httpchannel.service.AuthenticatorCapability;
|
||||
@@ -57,7 +60,7 @@ import com.rogiel.httpchannel.service.exception.DownloadLimitExceededException;
|
||||
import com.rogiel.httpchannel.service.exception.DownloadLinkNotFoundException;
|
||||
import com.rogiel.httpchannel.util.HttpClientUtils;
|
||||
import com.rogiel.httpchannel.util.PatternUtils;
|
||||
import com.rogiel.httpchannel.util.htmlparser.HTMLPage;
|
||||
import com.rogiel.httpchannel.util.html.Page;
|
||||
|
||||
/**
|
||||
* This service handles login, upload and download to MegaUpload.com.
|
||||
@@ -198,7 +201,12 @@ public class MegaUploadService extends AbstractHttpService implements Service,
|
||||
|
||||
@Override
|
||||
public CapabilityMatrix<AuthenticatorCapability> getAuthenticationCapability() {
|
||||
return new CapabilityMatrix<AuthenticatorCapability>();
|
||||
return new CapabilityMatrix<AuthenticatorCapability>(AuthenticatorCapability.ACCOUNT_DETAILS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountDetails getAccountDetails() {
|
||||
return account;
|
||||
}
|
||||
|
||||
protected class UploaderImpl extends
|
||||
@@ -215,16 +223,16 @@ public class MegaUploadService extends AbstractHttpService implements Service,
|
||||
@Override
|
||||
public UploadChannel openChannel() throws IOException {
|
||||
logger.debug("Starting upload to megaupload.com");
|
||||
final HTMLPage page = get("http://www.megaupload.com/multiupload/")
|
||||
final Page page = get("http://www.megaupload.com/multiupload/")
|
||||
.asPage();
|
||||
final String uri = page.findFormAction(UPLOAD_URL_PATTERN);
|
||||
final String uri = page.form(UPLOAD_URL_PATTERN).asString();
|
||||
logger.debug("Upload URI is {}", uri);
|
||||
|
||||
final LinkedUploadChannel channel = createLinkedChannel(this);
|
||||
uploadFuture = multipartPost(uri)
|
||||
.parameter("multimessage_0", configuration.description())
|
||||
.parameter("multifile_0", channel).asStringAsync();
|
||||
return waitChannelLink(channel, uploadFuture);
|
||||
return waitChannelLink(channel);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -271,16 +279,16 @@ public class MegaUploadService extends AbstractHttpService implements Service,
|
||||
response = get(uri).request();
|
||||
}
|
||||
|
||||
final HTMLPage page = HttpClientUtils.toPage(response);
|
||||
final Page page = HttpClientUtils.toPage(response);
|
||||
|
||||
// try to find timer
|
||||
int timer = page.findScriptAsInt(DOWNLOAD_TIMER, 1);
|
||||
int timer = page.script(DOWNLOAD_TIMER).asInteger(1);
|
||||
if (timer > 0 && configuration.getRespectWaitTime()) {
|
||||
logger.debug("");
|
||||
timer(listener, timer * 1000);
|
||||
}
|
||||
final String downloadUrl = page
|
||||
.findLink(DOWNLOAD_DIRECT_LINK_PATTERN);
|
||||
.link(DOWNLOAD_DIRECT_LINK_PATTERN).asString();
|
||||
if (downloadUrl != null && downloadUrl.length() > 0) {
|
||||
final HttpResponse downloadResponse = get(downloadUrl)
|
||||
.position(position).request();
|
||||
@@ -312,17 +320,17 @@ public class MegaUploadService extends AbstractHttpService implements Service,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void login() throws IOException {
|
||||
public AccountDetails login() throws IOException {
|
||||
logger.debug("Starting login to megaupload.com");
|
||||
final HTMLPage page = post("http://www.megaupload.com/?c=login")
|
||||
final Page page = post("http://www.megaupload.com/?c=login")
|
||||
.parameter("login", true)
|
||||
.parameter("username", credential.getUsername())
|
||||
.parameter("", credential.getPassword()).asPage();
|
||||
|
||||
String username = page.findScript(LOGIN_USERNAME_PATTERN, 1);
|
||||
String username = page.script(LOGIN_USERNAME_PATTERN).asString(1);
|
||||
if (username == null)
|
||||
throw new AuthenticationInvalidCredentialException();
|
||||
serviceMode = ServiceMode.NON_PREMIUM;
|
||||
return (account = new AccountDetailsImpl(credential.getUsername()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -333,6 +341,23 @@ public class MegaUploadService extends AbstractHttpService implements Service,
|
||||
}
|
||||
}
|
||||
|
||||
private class AccountDetailsImpl extends AbstractAccountDetails implements
|
||||
PremiumAccountDetails {
|
||||
/**
|
||||
* @param username
|
||||
* the username
|
||||
*/
|
||||
public AccountDetailsImpl(String username) {
|
||||
super(MegaUploadService.this, username);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPremium() {
|
||||
// TODO implement this
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.getClass().getSimpleName() + " " + getMajorVersion() + "."
|
||||
@@ -16,12 +16,12 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package com.rogiel.httpchannel.service.impl;
|
||||
package com.rogiel.httpchannel.service.megaupload;
|
||||
|
||||
import com.rogiel.httpchannel.service.AbstractUploaderConfiguration;
|
||||
import com.rogiel.httpchannel.service.Uploader.DescriptionableUploaderConfiguration;
|
||||
import com.rogiel.httpchannel.service.Uploader.UploaderConfiguration;
|
||||
import com.rogiel.httpchannel.service.impl.MegaUploadService.UploaderImpl;
|
||||
import com.rogiel.httpchannel.service.megaupload.MegaUploadService.UploaderImpl;
|
||||
|
||||
/**
|
||||
* Describes an configuration for an {@link UploaderImpl}
|
||||
@@ -1 +1 @@
|
||||
com.rogiel.httpchannel.service.impl.MegaUploadService
|
||||
com.rogiel.httpchannel.service.megaupload.MegaUploadService
|
||||
@@ -23,6 +23,7 @@ import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.rogiel.httpchannel.service.helper.Services;
|
||||
import com.rogiel.httpchannel.service.megaupload.MegaUploadService;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
|
||||
@@ -46,6 +46,8 @@ import com.rogiel.httpchannel.service.UploadChannel;
|
||||
import com.rogiel.httpchannel.service.UploaderCapability;
|
||||
import com.rogiel.httpchannel.service.exception.AuthenticationInvalidCredentialException;
|
||||
import com.rogiel.httpchannel.service.helper.UploadServices;
|
||||
import com.rogiel.httpchannel.service.megaupload.MegaUploadDownloaderConfiguration;
|
||||
import com.rogiel.httpchannel.service.megaupload.MegaUploadService;
|
||||
import com.rogiel.httpchannel.util.ChannelUtils;
|
||||
|
||||
public class MegaUploadServiceTest {
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
<parent>
|
||||
<artifactId>httpchannel-service</artifactId>
|
||||
<groupId>com.rogiel.httpchannel</groupId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>httpchannel-service-multiupload</artifactId>
|
||||
<groupId>com.rogiel.httpchannel.services</groupId>
|
||||
<name>HttpChannel/Service/MultiUpload</name>
|
||||
<description>Provides upload access to multiupload.com</description>
|
||||
<description>Provides upload access to multiupload.nl</description>
|
||||
</project>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user