Skip to content

Commit dde7c5f

Browse files
committed
Merge branch 'dev'
Release v0.3
2 parents 4967882 + 0d6e4c5 commit dde7c5f

28 files changed

+1908
-201
lines changed

CONTRIBUTING.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
Contributing
2+
============
3+
4+
All contributions are welcome to this project.
5+
6+
Contributor License Agreement
7+
-----------------------------
8+
9+
Before a contribution can be merged into this project, please fill out the
10+
Contributor License Agreement (CLA) located at:
11+
12+
http://opensource.box.com/cla
13+
14+
To learn more about CLAs and why they are important to open source projects,
15+
please see the [Wikipedia entry][1].
16+
17+
How to contribute
18+
-----------------
19+
20+
* **File an issue** - if you found a bug, want to request an enhancement, or
21+
want to implement something (bug fix or feature).
22+
* **Send a pull request** - if you want to contribute code. Please be sure to
23+
file an issue first.
24+
25+
Pull request best practices
26+
---------------------------
27+
28+
Following these steps will help ensure that your pull request gets reviewed and
29+
accepted as quickly as possible.
30+
31+
### Step 1: File an issue
32+
33+
Before writing any code, please file an issue stating the problem you want to
34+
solve or the feature you want to implement. This allows us to give you feedback
35+
before you spend any time writing code. There may be a known limitation that
36+
can't be addressed, or a bug that has already been fixed in a different way. The
37+
issue allows us to communicate and figure out if it's worth your time to write a
38+
bunch of code for the project.
39+
40+
### Step 2: Fork this repository in GitHub
41+
42+
This will create your own copy of our repository.
43+
44+
### Step 3: Add the upstream source
45+
46+
The upstream source is the project under the Box organization on GitHub. To add
47+
an upstream source for this project, type:
48+
49+
```
50+
git remote add upstream [email protected]:box/box-java-sdk.git
51+
```
52+
53+
This will come in useful later.
54+
55+
### Step 4: Create a feature branch
56+
57+
Create a branch with a descriptive name, such as `add-search`.
58+
59+
### Step 5: Push your feature branch to your fork
60+
61+
As you develop code, continue to push code to your remote feature branch. Please
62+
make sure to include the issue number you're addressing in the body of your
63+
commit message and adhere to [standard git commit message guidelines][2]. For
64+
example:
65+
66+
```
67+
Add search
68+
69+
Introduced a new BoxSearch class that uses the /search API endpoint.
70+
71+
Closes #123.
72+
```
73+
74+
This helps us out by allowing us to track which issue your commit relates to.
75+
76+
Keep a separate feature branch for each issue you want to address.
77+
78+
### Step 6: Rebase
79+
80+
Before sending a pull request, rebase against upstream, such as:
81+
82+
```
83+
git fetch upstream
84+
git rebase upstream/master
85+
```
86+
87+
This will add your changes on top of what's already in upstream, minimizing
88+
merge issues.
89+
90+
### Step 7: Build and test your changes
91+
92+
Make sure that the code builds and passes all unit tests by running:
93+
94+
```bash
95+
$ gradle clean build
96+
```
97+
98+
### Step 8: Send the pull request
99+
100+
Send the pull request from your feature branch to us. Be sure to include a
101+
description in your commit message (not the pull request description) that lets
102+
us know what work you did.
103+
104+
Keep in mind that we like to see one issue addressed per pull request, as this
105+
helps keep our git history clean and we can more easily track down issues.
106+
107+
[1]: http://en.wikipedia.org/wiki/Contributor_License_Agreement
108+
[2]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

build.gradle

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,19 @@ dependencies {
1818
testCompile 'org.slf4j:slf4j-nop:1.7.7'
1919
}
2020

21-
tasks.withType(JavaCompile) {
22-
options.compilerArgs << '-Xlint:all'
21+
javadoc {
22+
options.windowTitle 'Box Java SDK'
23+
options.noQualifiers 'all'
24+
options.stylesheetFile file('doc/css/javadoc.css')
25+
options.noTree true
26+
options.noIndex true
27+
options.noHelp true
28+
options.noDeprecatedList true
29+
options.noNavBar true
30+
options.docEncoding 'utf-8'
31+
options.charSet 'utf-8'
32+
options.linkSource true
33+
options.links 'http://docs.oracle.com/javase/8/docs/api/'
2334
}
2435

2536
task javadocJar(type: Jar) {
@@ -32,8 +43,19 @@ task sourcesJar(type: Jar) {
3243
from sourceSets.main.allSource
3344
}
3445

35-
artifacts {
36-
archives sourcesJar, javadocJar
46+
task integrationTest(type: Test) {
47+
description 'Runs the integration tests.'
48+
group 'Verification'
49+
50+
useJUnit {
51+
includeCategories 'com.box.sdk.IntegrationTest'
52+
}
53+
}
54+
55+
jacocoTestReport.dependsOn(integrationTest);
56+
57+
tasks.withType(JavaCompile) {
58+
options.compilerArgs << '-Xlint:all'
3759
}
3860

3961
tasks.withType(Test) {
@@ -48,32 +70,12 @@ tasks.withType(Test) {
4870
}
4971
}
5072

51-
test {
52-
useJUnit {
53-
excludeCategories 'com.box.sdk.IntegrationTest'
54-
}
73+
artifacts {
74+
archives sourcesJar, javadocJar
5575
}
5676

57-
task integrationTest(type: Test) {
58-
description 'Runs the integration tests.'
59-
group 'Verification'
60-
77+
test {
6178
useJUnit {
62-
includeCategories 'com.box.sdk.IntegrationTest'
79+
excludeCategories 'com.box.sdk.IntegrationTest'
6380
}
6481
}
65-
66-
javadoc {
67-
options.windowTitle 'Box Java SDK'
68-
options.noQualifiers 'all'
69-
options.stylesheetFile file('doc/css/javadoc.css')
70-
options.noTree true
71-
options.noIndex true
72-
options.noHelp true
73-
options.noDeprecatedList true
74-
options.noNavBar true
75-
options.docEncoding 'utf-8'
76-
options.charSet 'utf-8'
77-
options.linkSource true
78-
options.links 'http://docs.oracle.com/javase/8/docs/api/'
79-
}

doc/css/javadoc.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ div.summary ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.
217217
position: relative;
218218
}
219219
.indexContainer {
220-
background-color: rgb(64, 64, 64);
221220
margin: 10px;
222221
position: relative;
223222
font-size: 1.0em;

doc/overview.md

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ This guide covers the basics behind the various components of the Box Java SDK.
55
It's also recommended that you take a look at [the
66
documentation](https://developers.box.com/docs/) for the Box API.
77

8-
API Connections
9-
---------------
8+
Authentication
9+
--------------
1010

1111
The first step in using the SDK is always authenticating and connecting to the
1212
API. The SDK does this through the `BoxAPIConnection` class. This class
@@ -24,28 +24,6 @@ a connection for each user if your application supports multiple user accounts.
2424
See the [Authentication guide](authentication.md) for details on how to create
2525
and use `BoxAPIConnection`.
2626

27-
Requests and Responses
28-
----------------------
29-
30-
All communication with Box's API is done through `BoxAPIRequest` and
31-
`BoxAPIResponse` (or their subclasses). These classes handle all the dirty work
32-
of setting appropriate headers, handling errors, and sending/receiving data.
33-
34-
You generally won't need to use these classes directly, as the resource types
35-
are easier and cover most use-cases. However, these classes are extremely
36-
flexible and can be used if you need to make custom API calls.
37-
38-
Here's an example using `BoxAPIRequest` and `BoxJSONResponse` that gets a list
39-
of items with some custom fields:
40-
41-
```java
42-
BoxAPIConnection api = new BoxAPIConnection("token");
43-
URL url = new URL("https://api.box.com/2.0/folders/0/items?fields=name,created_at")
44-
BoxAPIRequest request = new BoxAPIRequest(api, url, "GET");
45-
BoxJSONResponse response = (BoxJSONResponse) request.send();
46-
String json = response.getJSON();
47-
```
48-
4927
Resource Types
5028
--------------
5129

@@ -72,3 +50,29 @@ BoxFolder.Info info = folder.getInfo();
7250
// This BoxUser has the same BoxAPIConnection as "folder".
7351
BoxUser creator = info.getCreatedBy();
7452
```
53+
54+
### Resource Docs
55+
56+
* [Files](types/files.md)
57+
58+
Requests and Responses
59+
----------------------
60+
61+
All communication with Box's API is done through `BoxAPIRequest` and
62+
`BoxAPIResponse` (or their subclasses). These classes handle all the dirty work
63+
of setting appropriate headers, handling errors, and sending/receiving data.
64+
65+
You generally won't need to use these classes directly, as the resource types
66+
are easier and cover most use-cases. However, these classes are extremely
67+
flexible and can be used if you need to make custom API calls.
68+
69+
Here's an example using `BoxAPIRequest` and `BoxJSONResponse` that gets a list
70+
of items with some custom fields:
71+
72+
```java
73+
BoxAPIConnection api = new BoxAPIConnection("token");
74+
URL url = new URL("https://api.box.com/2.0/folders/0/items?fields=name,created_at")
75+
BoxAPIRequest request = new BoxAPIRequest(api, url, "GET");
76+
BoxJSONResponse response = (BoxJSONResponse) request.send();
77+
String json = response.getJSON();
78+
```

doc/resource-types.md

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)