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

Implements 4shared.com service

This commit is contained in:
2012-01-20 00:42:10 -02:00
parent cd2b479b5b
commit 95b549da2c
73 changed files with 7397 additions and 217 deletions

View File

@@ -0,0 +1,38 @@
<?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>org.apache.axis2</groupId>
<artifactId>axis2</artifactId>
<version>1.6.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.james</groupId>
<artifactId>apache-mime4j</artifactId>
<version>0.7.2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.2.7</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.2.7-promoted-b09</version>
</dependency>
</dependencies>
</project>

View File

@@ -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>
* &lt;complexType name="accountItem">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="date" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
* &lt;element name="directory" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="downloadCount" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="downloadLink" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="empty" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}long"/>
* &lt;element name="md5" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="parentId" type="{http://www.w3.org/2001/XMLSchema}long"/>
* &lt;element name="removed" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="shared" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="size" type="{http://www.w3.org/2001/XMLSchema}long"/>
* &lt;element name="version" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -0,0 +1,69 @@
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>
* &lt;complexType name="accountItemArray">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="item" type="{http://api.soap.shared.pmstation.com/}accountItem" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -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;
}
}

View File

@@ -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);
}
}

View File

@@ -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>
* &lt;complexType name="dirHistoryDTO">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="compId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="date" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
* &lt;element name="dirId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
* &lt;element name="fileId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
* &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}long"/>
* &lt;element name="operation" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="parentDirId" type="{http://www.w3.org/2001/XMLSchema}long"/>
* &lt;element name="sourceDirId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
* &lt;element name="sourceFileId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -0,0 +1,69 @@
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>
* &lt;complexType name="dirHistoryDTOArray">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="item" type="{http://api.soap.shared.pmstation.com/}dirHistoryDTO" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -0,0 +1,69 @@
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>
* &lt;complexType name="dirHistoryDTOArrayArray">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="item" type="{http://api.soap.shared.pmstation.com/}dirHistoryDTOArray" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -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>
* &lt;complexType name="exifInfo">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="dateTime" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="empty" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="fileId" type="{http://www.w3.org/2001/XMLSchema}long"/>
* &lt;element name="heigth" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="make" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="model" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="width" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -0,0 +1,69 @@
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>
* &lt;complexType name="exifInfoArray">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="item" type="{http://api.soap.shared.pmstation.com/}exifInfo" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -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>
* &lt;complexType name="faultBean">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="details" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="exceptionClass" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -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>
* &lt;complexType name="fileUploadInfo">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="fileId" type="{http://www.w3.org/2001/XMLSchema}long"/>
* &lt;element name="freeSpace" type="{http://www.w3.org/2001/XMLSchema}long"/>
* &lt;element name="maxFileSize" type="{http://www.w3.org/2001/XMLSchema}long"/>
* &lt;element name="message" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="uploadUrl" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -0,0 +1,69 @@
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>
* &lt;complexType name="longArray">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="item" type="{http://www.w3.org/2001/XMLSchema}long" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -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>
* &lt;complexType name="mp3Info">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="album" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="artist" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="bitrate" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="empty" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="fileId" type="{http://www.w3.org/2001/XMLSchema}long"/>
* &lt;element name="genre" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="length" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="preciseLength" type="{http://www.w3.org/2001/XMLSchema}float"/>
* &lt;element name="sampleRate" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="track" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="year" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -0,0 +1,69 @@
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>
* &lt;complexType name="mp3InfoArray">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="item" type="{http://api.soap.shared.pmstation.com/}mp3Info" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -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);
}
}

View File

@@ -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>
* &lt;complexType name="settingsGroup">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="groupId" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="groupName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="translatedName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -0,0 +1,69 @@
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>
* &lt;complexType name="settingsGroupArray">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="item" type="{http://api.soap.shared.pmstation.com/}settingsGroup" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -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>
* &lt;complexType name="sharedFolderProperties">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="createSubFolders" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="delete" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="disableAnonimUpload" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="emailOnUpload" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="embed" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="fileProperties" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="moderator" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="onlyPublic" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="password" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="publicSearch" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="search" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="shared" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="subdomainAllowed" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="subdomainName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="thumbNailOn" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="updateFiles" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="upload" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="viewModeDetails" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="viewSubfolders" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="webGrab" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -0,0 +1,69 @@
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>
* &lt;complexType name="sharedFolderPropertiesArray">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="item" type="{http://api.soap.shared.pmstation.com/}sharedFolderProperties" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -0,0 +1,69 @@
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>
* &lt;complexType name="stringArray">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="item" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -0,0 +1,215 @@
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>
* &lt;complexType name="userSetting">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="editable" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="possibleValues" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
* &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -0,0 +1,96 @@
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>
* &lt;complexType name="userSettings">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="settings" type="{http://api.soap.shared.pmstation.com/}userSetting" maxOccurs="unbounded" minOccurs="0"/>
* &lt;element name="settingsGroup" type="{http://api.soap.shared.pmstation.com/}settingsGroup" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -0,0 +1,69 @@
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>
* &lt;complexType name="userSettingsArray">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="item" type="{http://api.soap.shared.pmstation.com/}userSettings" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/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;
}
}

View File

@@ -0,0 +1,2 @@
@javax.xml.bind.annotation.XmlSchema(namespace = "http://api.soap.shared.pmstation.com/")
package com.pmstation.shared.soap.client;

View File

@@ -0,0 +1,261 @@
/*
* 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 org.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.AbstractAuthenticator;
import com.rogiel.httpchannel.service.AbstractHttpService;
import com.rogiel.httpchannel.service.AbstractUploader;
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.AuthenticationServiceException;
import com.rogiel.httpchannel.service.exception.ChannelServiceException;
import com.rogiel.httpchannel.service.exception.DownloadLinkNotFoundException;
import com.rogiel.httpchannel.util.htmlparser.HTMLPage;
/**
* 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();
private String username;
private String password;
@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() {
try {
final long free = api.getFreeSpace(username, password);
final long max = api.getMaxFileSize(username, password);
if (max < free)
return max;
else
return free;
} catch (ApiException e) {
return 0;
}
}
@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>();
}
protected class UploaderImpl extends
AbstractUploader<NullUploaderConfiguration> implements
Uploader<NullUploaderConfiguration>,
LinkedUploadChannelCloseCallback {
private Future<HTMLPage> 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(username,
password, -1);
logger.debug("SessionID: {}", sessionID);
if (sessionID == null || sessionID.length() == 0)
throw new ChannelServiceException("SessionID is invalid");
final long datacenterID = api.getNewFileDataCenter(username,
password);
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, uploadFuture);
} catch (ApiException e) {
throw new ChannelServiceException(e);
}
}
@Override
public String finish() throws IOException {
try {
final long linkID = Long.parseLong(uploadFuture.get()
.getInputValueById("uploadedFileId"));
return api.getFileDownloadLink(username, password, linkID);
} catch (InterruptedException e) {
return null;
} catch (ExecutionException e) {
throw (IOException) e.getCause();
} catch (ApiException e) {
throw new DownloadLinkNotFoundException(e);
}
}
}
protected class AuthenticatorImpl extends
AbstractAuthenticator<NullAuthenticatorConfiguration> implements
Authenticator<NullAuthenticatorConfiguration> {
public AuthenticatorImpl(Credential credential,
NullAuthenticatorConfiguration configuration) {
super(credential, configuration);
}
@Override
public void login() throws IOException {
logger.debug("Logging to 4shared.com");
final String response = api.login(credential.getUsername(),
credential.getPassword());
username = credential.getUsername();
password = credential.getPassword();
try {
if (api.isAccountPremium(username, password))
serviceMode = ServiceMode.PREMIUM;
else
serviceMode = ServiceMode.NON_PREMIUM;
} catch (ApiException e) {
throw new AuthenticationServiceException(e);
}
if (!response.isEmpty())
throw new AuthenticationInvalidCredentialException();
}
@Override
public void logout() throws IOException {
username = null;
password = null;
}
}
@Override
public String toString() {
return this.getClass().getSimpleName() + " " + getMajorVersion() + "."
+ getMinorVersion();
}
}

View File

@@ -0,0 +1 @@
org.httpchannel.service.fourshared.FourSharedService

View File

@@ -0,0 +1,36 @@
/**
*
*/
package org.httpchannel.service.fourshared;
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.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();
@Test
public void test() throws IOException {
AuthenticationServices.authenticator(service, "", "").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);
}
}