Created
July 11, 2011 20:20
-
-
Save paddycarver/1076704 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.suchagit.android2cloud.util; | |
import java.util.List; | |
import org.apache.http.NameValuePair; | |
import org.apache.http.client.methods.HttpPost; | |
import org.apache.http.message.BasicNameValuePair; | |
public class AddLinkRequest extends HttpPost { | |
private String link; | |
private String sender; | |
private String receiver; | |
private List<NameValuePair> data; | |
public void setLink(String url) { | |
this.link = url; | |
} | |
public String getLink() { | |
return this.link; | |
} | |
public void setSender(String newSender) { | |
this.sender = newSender; | |
} | |
public String getSender() { | |
return this.sender; | |
} | |
public void setReceiver(String newReceiver) { | |
this.receiver = newReceiver; | |
} | |
public String getReceiver() { | |
return this.receiver; | |
} | |
public void addData(String name, String value) { | |
this.data.add(new BasicNameValuePair(name, value)); | |
} | |
public void clearData() { | |
this.data.clear(); | |
} | |
public List<NameValuePair> getData() { | |
return this.data; | |
} | |
public AddLinkRequest(String host, String receiver, String sender, String link) { | |
super(host+"links/add"); | |
this.setReceiver(receiver); | |
this.setSender(sender); | |
this.setLink(link); | |
this.addData("link", this.getLink()); | |
this.addData("name", this.getSender()); | |
this.addData("receiver", this.getReceiver()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment