Skip to content

Commit 12f54e8

Browse files
committed
initial content
0 parents  commit 12f54e8

File tree

86 files changed

+6046
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+6046
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
README.html
2+
build/
3+
output/
4+
shared_content/

LICENSE

Lines changed: 282 additions & 0 deletions
Large diffs are not rendered by default.

README.rst

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
.. Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
3+
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0
4+
International License (the "License"). You may not use this file except in compliance with the
5+
License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/.
6+
7+
This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
8+
either express or implied. See the License for the specific language governing permissions and
9+
limitations under the License.
10+
11+
############################
12+
aws-java-developer-guide
13+
############################
14+
15+
.. Links used in the README. For sanity's sake, keep this list sorted alphabetically. ;)
16+
.. _`available sphinx builders`: http://www.sphinx-doc.org/en/stable/builders.html
17+
.. _`aws sdk for java developer guide`: http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/welcome.html
18+
.. _`forking the repository`: https://help.github.com/articles/fork-a-repo/
19+
.. _`pull request`: https://help.github.com/articles/using-pull-requests/
20+
.. _`shared content`: https://github.com/awsdocs/aws-doc-shared-content
21+
.. _extlinks: http://www.sphinx-doc.org/en/stable/ext/extlinks.html
22+
.. _issues: https://github.com/awsdocs/aws-java-developer-guide/issues
23+
.. _restructuredtext: http://docutils.sourceforge.net/rst.html
24+
.. _sphinx: http://www.sphinx-doc.org/en/stable/
25+
.. _substitutions: http://www.sphinx-doc.org/en/stable/rest.html#substitutions
26+
27+
28+
This repository contains content for the official `AWS SDK for Java Developer Guide`_.
29+
30+
The developer guide is written in reStructuredText_ and built using Sphinx_. It relies on shared
31+
content that is provided in the `shared content`_ repository, which is also provided on GitHub.
32+
33+
34+
Reporting issues
35+
================
36+
37+
You can use the Issues_ section of this repository to report problems in the documentation. *When
38+
submitting an issue, please indicate*:
39+
40+
* what page (a URL or filename is best) the issue occurs on.
41+
42+
* what the issue is, using as much detail as you can provide. For many issues, this might be as
43+
simple as "The page has a typo; the word 'complie' in the third paragraph shoud be 'compile'." If
44+
the issue is more complex, please describe it with enough detail that it's clear to the AWS
45+
documentation team what the problem is.
46+
47+
48+
Contributing fixes and updates
49+
==============================
50+
51+
To contribute your own documentation fixes or updates, please use the Github-standard procedures for
52+
`forking the repository`_ and submitting a `pull request`_.
53+
54+
Note that many common substitutions_ and extlinks_ found in these docs are sourced from the `shared
55+
content`_ repository--if you see a substitution used that is not declared at the top of the source
56+
file or in the ``_includes.txt`` file, then it is probably defined in the shared content.
57+
58+
59+
Building the documentation
60+
--------------------------
61+
62+
If you are planning to contribute to the docs, you should build your changes and review them before
63+
submitting your pull request.
64+
65+
**To build the docs:**
66+
67+
1. Make sure that you have downloaded and installed Sphinx_.
68+
2. Run the ``build_docs.py`` script in the repository's root directory.
69+
70+
The build process will automatically download a snapshot of the `shared content`_, combine it in the
71+
``build`` directory and will generate output into the ``output`` directory.
72+
73+
``build_docs.py`` can take any of the `available Sphinx builders`_ as its argument. For example, to
74+
build the docs into a single HTML page, you can use the ``htmlsingle`` target, like so::
75+
76+
python build_docs.py htmlsingle
77+
78+
79+
Copyright and license
80+
=====================
81+
82+
All content in this repository, unless otherwise stated, is Copyright © 2010-2016, Amazon Web
83+
Services, Inc. or its affiliates. All rights reserved.
84+
85+
Except where otherwise noted, this work is licensed under a `Creative Commons
86+
Attribution-NonCommercial-ShareAlike 4.0 International License
87+
<http://creativecommons.org/licenses/by-nc-sa/4.0/>`_ (the "License"). Use the preceding link for a
88+
human-readable summary of the license terms. The full license text is available at:
89+
http://creativecommons.org/licenses/by-nc-sa/4.0/legalcode and in the LICENSE file accompanying this
90+
repository.
91+

build_docs.py

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
# Documentation build script for AWS Sphinx documentation on GitHub.
5+
#
6+
# Author: Eron Hennessey ([email protected])
7+
#
8+
# Copyright © 2016, Amazon Web Services, Inc. or its affiliates. All rights reserved.
9+
10+
import sys, os
11+
import subprocess
12+
import shutil
13+
14+
SPHINX_MISSING = """
15+
You must have Sphinx installed to use this script!
16+
17+
Go to http://www.sphinx-doc.org for information about installing and using
18+
Sphinx.
19+
"""
20+
21+
FAILED_CHECKOUT = """
22+
Couldn't clone repository. Please make sure that you have 'git' installed and
23+
that you can access GitHub repositories using SSH.
24+
"""
25+
26+
AWS_SHARED_REPO = '[email protected]:awsdocs/aws-doc-shared-content.git'
27+
BUILD_DIR = 'build'
28+
OUTPUT_DIR = 'output'
29+
SHARED_DIR = 'shared_content'
30+
SHARED_SUBDIR = 'sphinx_shared'
31+
SOURCE_DIR = 'doc_source'
32+
33+
34+
def check_and_remove_dir(dir_name):
35+
"""Check to see if the named directory exists. If it does, then remove it.
36+
Throw an exception if the directory can't be removed."""
37+
38+
if os.path.exists(dir_name):
39+
print("Removing directory: " + dir_name)
40+
try:
41+
shutil.rmtree(dir_name)
42+
except:
43+
print("Couldn't remove " + dir_name)
44+
print("Remove this directory before building!")
45+
sys.exit(1)
46+
47+
48+
def copy_dir_contents_with_overwrite(input_dir_name, output_dir_name):
49+
"""Copy the contents of a directory into another, overwriting files if they
50+
exist."""
51+
52+
# if output_dir_name isn't a location, make it so.
53+
if not os.path.exists(output_dir_name):
54+
os.makedirs(output_dir_name)
55+
56+
dir_entries = os.listdir(input_dir_name)
57+
58+
for dir_entry in dir_entries:
59+
input_path = os.path.join(input_dir_name, dir_entry)
60+
output_path = os.path.join(output_dir_name, dir_entry)
61+
62+
if os.path.isdir(input_path):
63+
copy_dir_contents_with_overwrite(input_path, output_path)
64+
else:
65+
shutil.copyfile(input_path, output_path)
66+
67+
68+
def run():
69+
# try to import requirements, and complain if they can't be found.
70+
try:
71+
from sphinx import version_info as sphinx_version
72+
print("Using Sphinx version %s.%s.%s" % sphinx_version[0:3])
73+
except:
74+
print(SPHINX_MISSING)
75+
sys.exit(1)
76+
77+
build_target = 'html' # by default
78+
cmd_switches = []
79+
80+
for arg in sys.argv[1:]:
81+
if arg.startswith('--'):
82+
cmd_switches.append(arg)
83+
else:
84+
# the only non-switch argument is the output format.
85+
build_target = arg
86+
87+
print("Building '%s' target." % build_target)
88+
89+
#
90+
# Step 0: empty the build dir if it's there.
91+
#
92+
check_and_remove_dir(BUILD_DIR)
93+
check_and_remove_dir(SHARED_DIR)
94+
check_and_remove_dir(OUTPUT_DIR)
95+
96+
#
97+
# Step 1: grab the shared content and copy it into BUILD_DIR.
98+
#
99+
print("Getting shared content from " + AWS_SHARED_REPO)
100+
try:
101+
subprocess.check_call(['git', 'clone', '--depth', '1', AWS_SHARED_REPO,
102+
SHARED_DIR])
103+
except:
104+
print(FAILED_CHECKOUT)
105+
sys.exit(1)
106+
107+
shared_input_dir = os.path.join(SHARED_DIR, SHARED_SUBDIR)
108+
print("Copying shared content from %s to %s" % (shared_input_dir,
109+
BUILD_DIR))
110+
copy_dir_contents_with_overwrite(shared_input_dir, BUILD_DIR)
111+
112+
#
113+
# Step 2: copy the contents of SOURCE_DIR into the BUILD_DIR.
114+
#
115+
print("Copying doc sources from %s to %s" % (SOURCE_DIR, BUILD_DIR))
116+
copy_dir_contents_with_overwrite(SOURCE_DIR, BUILD_DIR)
117+
118+
#
119+
# Append the contents of any files in the 'build/_conf' directory to the
120+
# project's conf.py file (so that shared content can add commonly-used
121+
# extlinks, etc.).
122+
#
123+
conf_py_path = os.path.join(BUILD_DIR, 'conf.py')
124+
extra_conf_path = os.path.join(BUILD_DIR, '_conf')
125+
# first, open the conf.py file for appending...
126+
with open(conf_py_path, 'a') as conf_file:
127+
# now, add the contents of each file in alpha-sorted order.
128+
for filename in sorted(os.listdir(extra_conf_path)):
129+
print(" - %s" % filename)
130+
conf_file.write('# ** added by extra conf file: %s **\n' % filename)
131+
with open(os.path.join(extra_conf_path, filename), 'r') as extra_conf_file:
132+
conf_file.write(extra_conf_file.read())
133+
conf_file.write('# ** end of content from %s **\n' % filename)
134+
135+
#
136+
# Step 3: build the docs
137+
#
138+
print("Building documentation.")
139+
try:
140+
subprocess.check_call(['sphinx-build', '-b', build_target, BUILD_DIR,
141+
OUTPUT_DIR])
142+
except:
143+
print(FAILED_CHECKOUT)
144+
sys.exit(1)
145+
146+
#
147+
# Step 4: Clean up the build dir and shared content.
148+
#
149+
if '--noclean' not in cmd_switches:
150+
print("Cleaning up.")
151+
check_and_remove_dir(BUILD_DIR)
152+
check_and_remove_dir(SHARED_DIR)
153+
154+
print("Finished! You'll find the built docs in the '%s' directory." %
155+
OUTPUT_DIR)
156+
157+
158+
# If run from the command-line...
159+
if __name__ == '__main__':
160+
run()
161+

doc_source/_includes.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.. project-specific includes for this project.
2+
3+
.. |sdk-java-dl| replace:: http://aws.amazon.com/sdkforjava
4+
5+
.. |sdk-java-github| replace:: AWS SDK for Java (GitHub)
6+
.. _sdk-java-github: http://github.com/aws/aws-sdk-java
7+
8+
.. _Gradle: https://gradle.com/
9+
.. _Maven: http://maven.apache.org/
10+
11+

doc_source/advanced.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.. Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
3+
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0
4+
International License (the "License"). You may not use this file except in compliance with the
5+
License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/.
6+
7+
This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
8+
either express or implied. See the License for the specific language governing permissions and
9+
limitations under the License.
10+
11+
###############
12+
Advanced Topics
13+
###############
14+
15+
The topics in this section extend the content in :doc:`basics`, presenting information about
16+
advanced programming techniques and comprehensive examples of using the |sdk-java|.
17+
18+
.. tip:: See :ref:`additional-resources` for more examples and additional resources available for
19+
|sdk-java| developers!
20+
21+
.. toctree::
22+
:maxdepth: 1
23+
24+
section-client-configuration
25+
java-dg-access-control
26+

doc_source/basics.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.. Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
3+
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0
4+
International License (the "License"). You may not use this file except in compliance with the
5+
License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/.
6+
7+
This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
8+
either express or implied. See the License for the specific language governing permissions and
9+
limitations under the License.
10+
11+
#################
12+
|sdk-java| Basics
13+
#################
14+
15+
This section provides important general information about programming with the |sdk-java|.
16+
Information in this section applies to all services that you might be using with the |sdk-java|.
17+
18+
For information that is specific to a particular service (EC2, SWF, etc.), see the
19+
:doc:`prog-services` section.
20+
21+
.. toctree::
22+
:maxdepth: 1
23+
24+
credentials
25+
java-dg-region-selection
26+
java-dg-jvm-ttl
27+
java-dg-exceptions
28+
java-dg-logging

0 commit comments

Comments
 (0)