Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added API for accessing directories and files.
- Loading branch information
1 parent
e9880c8
commit e6dc8a2
Showing
8 changed files
with
370 additions
and
1 deletion.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
src/main/java/org/springframework/social/bitbucket/api/BitBucketDirectory.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.springframework.social.bitbucket.api; | ||
|
||
import java.util.List; | ||
|
||
import org.codehaus.jackson.annotate.JsonIgnoreProperties; | ||
import org.codehaus.jackson.annotate.JsonProperty; | ||
|
||
/** | ||
* Metadata about the contents of a repository directory. Contains files, | ||
* directories and metadata about the selected directory. | ||
* | ||
* @author ericbottard | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class BitBucketDirectory { | ||
|
||
@JsonProperty | ||
private List<String> directories; | ||
|
||
@JsonProperty | ||
private List<BitBucketFileMetadata> files; | ||
|
||
@JsonProperty | ||
private String path; | ||
|
||
@JsonProperty | ||
private String node; | ||
|
||
public List<String> getDirectories() { | ||
return directories; | ||
} | ||
|
||
public List<BitBucketFileMetadata> getFiles() { | ||
return files; | ||
} | ||
|
||
public String getPath() { | ||
return path; | ||
} | ||
|
||
public String getNode() { | ||
return node; | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/org/springframework/social/bitbucket/api/BitBucketFile.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.springframework.social.bitbucket.api; | ||
|
||
import org.codehaus.jackson.annotate.JsonIgnoreProperties; | ||
import org.codehaus.jackson.annotate.JsonProperty; | ||
|
||
/** | ||
* Content as well as metadata about a repository file. | ||
* | ||
* @author ebottard | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class BitBucketFile { | ||
|
||
@JsonProperty | ||
private String node; | ||
|
||
@JsonProperty | ||
private String path; | ||
|
||
@JsonProperty | ||
private String data; | ||
|
||
public String getNode() { | ||
return node; | ||
} | ||
|
||
/** | ||
* Returns the file path, relative to the root of the repository. | ||
*/ | ||
public String getPath() { | ||
return path; | ||
} | ||
|
||
/** | ||
* Returns the actual content of the file, as a String. | ||
*/ | ||
public String getData() { | ||
return data; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/org/springframework/social/bitbucket/api/BitBucketFileMetadata.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.springframework.social.bitbucket.api; | ||
|
||
import java.util.Date; | ||
|
||
import org.codehaus.jackson.annotate.JsonIgnoreProperties; | ||
import org.codehaus.jackson.annotate.JsonProperty; | ||
import org.codehaus.jackson.map.annotate.JsonDeserialize; | ||
import org.springframework.social.bitbucket.api.impl.UTCDateDeserializer; | ||
|
||
/** | ||
* Metadata about a file in a repository. | ||
* | ||
* @author ericbottard | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class BitBucketFileMetadata { | ||
|
||
@JsonProperty | ||
private String path; | ||
|
||
@JsonProperty | ||
private String revision; | ||
|
||
@JsonProperty("utctimestamp") | ||
@JsonDeserialize(using = UTCDateDeserializer.class) | ||
private Date timestamp; | ||
|
||
@JsonProperty | ||
private int size; | ||
|
||
public String getPath() { | ||
return path; | ||
} | ||
|
||
public String getRevision() { | ||
return revision; | ||
} | ||
|
||
public Date getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
public int getSize() { | ||
return size; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.