Skip to content

Extra fields #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 9, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public class ZencoderJob {
private boolean isTest = false;

private boolean isPrivate = false;

private String credentials;

private List<ZencoderOutput> outputs = new ArrayList<ZencoderOutput>();

Expand Down Expand Up @@ -94,6 +96,13 @@ public Document createXML() throws ParserConfigurationException {
region.setTextContent(this.zencoderRegion.getRegionCode());
root.appendChild(region);
}

// credentials
if (this.credentials != null) {
Node credentials = document.createElement("credentials");
credentials.setTextContent(this.credentials);
root.appendChild(credentials);
}

Node download_connections = document
.createElement("download_connections");
Expand Down Expand Up @@ -172,6 +181,10 @@ public String getInputPath() {
public ZencoderRegion getZencoderRegion() {
return zencoderRegion;
}

public String getCredentials() {
return credentials;
}

public int getDownloadConnections() {
return downloadConnections;
Expand Down Expand Up @@ -208,6 +221,10 @@ public void setTest(boolean isTest) {
public void setPrivate(boolean isPrivate) {
this.isPrivate = isPrivate;
}

public void setCredentials(String credentials) {
this.credentials = credentials;
}

public void addNotification(ZencoderNotification item) {
this.notifications.add(item);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public class ZencoderOutput {
* S3
*/
private boolean isPublic = false;
private String credentials;
private List<ZencoderS3AccessControlItem> aclItems = new ArrayList<ZencoderS3AccessControlItem>();
private Map<String, String> headers = new HashMap<String, String>();

Expand Down Expand Up @@ -127,6 +128,7 @@ public Element createXML(Document document) {
createAndAppendElement("start_clip", this.startClip, root);
createAndAppendElement("clip_length", this.clipLength, root);
createAndAppendElement("public", this.isPublic, root);
createAndAppendElement("credentials", this.credentials, root);

createAndAppendElement("video_codec", this.videoCodec.name(), root);
createAndAppendElement("width", this.width, root);
Expand Down Expand Up @@ -386,6 +388,10 @@ public boolean isSkipAudio() {
public boolean isPublic() {
return isPublic;
}

public String getCredentials() {
return credentials;
}

/*
* ###### Setters #########
Expand Down Expand Up @@ -600,6 +606,10 @@ public void setThumbnail(ZencoderThumbnail thumbnail) {
public void setPublic(boolean isPublic) {
this.isPublic = isPublic;
}

public void setCredentials(String credentials) {
this.credentials = credentials;
}

public void addAcl(ZencoderS3AccessControlItem item) {
this.aclItems.add(item);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ public class ZencoderThumbnail {
private String size;
private String baseUrl;
private String prefix;
private String filename;
private ZencoderThumbnailFormat format;

/*
* S3
*/
private boolean isPublic = false;
private String credentials;
private List<ZencoderS3AccessControlItem> aclItems = new ArrayList<ZencoderS3AccessControlItem>();

public Element createXML(Document document) {
Expand Down Expand Up @@ -95,10 +97,22 @@ public Element createXML(Document document) {
prefixNode.setTextContent(this.prefix);
root.appendChild(prefixNode);
}

if(this.filename != null) {
Node filenameNode = document.createElement("filename");
filenameNode.setTextContent(this.filename);
root.appendChild(filenameNode);
}

Node publicNode = document.createElement("public");
publicNode.setTextContent(this.isPublic ? "1" : "0");
root.appendChild(publicNode);

if(this.credentials != null) {
Node credentialsNode = document.createElement("credentials");
credentialsNode.setTextContent(this.credentials);
root.appendChild(credentialsNode);
}

if (this.aclItems.size() != 0) {
Element acl = document.createElement("access-controls");
Expand Down Expand Up @@ -136,13 +150,22 @@ public String getBaseUrl() {
public String getPrefix() {
return prefix;
}

public String getFilename() {
return filename;
}

public ZencoderThumbnailFormat getFormat() {
return format;
}

public boolean isPublic() {
return isPublic;
}

public String getCredentials() {
return credentials;
}


public void setFormat(ZencoderThumbnailFormat format) {
Expand Down Expand Up @@ -171,10 +194,18 @@ public void setBaseUrl(String baseUrl) {
public void setPrefix(String prefix) {
this.prefix = prefix;
}

public void setFilename(String filename) {
this.filename = filename;
}

public void setPublic(boolean isPublic) {
this.isPublic = isPublic;
}

public void setCredentials(String credentials) {
this.credentials = credentials;
}

public void addAcl(ZencoderS3AccessControlItem item) {
this.aclItems.add(item);
Expand Down