diff --git a/.gitignore b/.gitignore
index ad0bab4..d1c0c32 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@ target
.settings/
.project
.settings
+.vscode/settings.json
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
index c48100e..f9058f6
--- a/README.md
+++ b/README.md
@@ -29,7 +29,7 @@ Add the following dependency to your `pom.xml`:
```xml
com.autodesk
- com-autodesk-client
+ forge-java-sdk1.0.2
```
diff --git a/docs/DerivativesApi.md b/docs/DerivativesApi.md
index 71c23d3..af9805c 100644
--- a/docs/DerivativesApi.md
+++ b/docs/DerivativesApi.md
@@ -1,272 +1,274 @@
-# DerivativesApi
-
-All URIs are relative to *https://developer.api.autodesk.com/*
-
-Method | HTTP request | Description
-------------- | ------------- | -------------
-[**deleteManifest**](DerivativesApi.md#deleteManifest) | **DELETE** /modelderivative/v2/designdata/{urn}/manifest |
-[**getDerivativeManifest**](DerivativesApi.md#getDerivativeManifest) | **GET** /modelderivative/v2/designdata/{urn}/manifest/{derivativeUrn} |
-[**getFormats**](DerivativesApi.md#getFormats) | **GET** /modelderivative/v2/designdata/formats |
-[**getManifest**](DerivativesApi.md#getManifest) | **GET** /modelderivative/v2/designdata/{urn}/manifest |
-[**getMetadata**](DerivativesApi.md#getMetadata) | **GET** /modelderivative/v2/designdata/{urn}/metadata |
-[**getModelviewMetadata**](DerivativesApi.md#getModelviewMetadata) | **GET** /modelderivative/v2/designdata/{urn}/metadata/{guid} |
-[**getModelviewProperties**](DerivativesApi.md#getModelviewProperties) | **GET** /modelderivative/v2/designdata/{urn}/metadata/{guid}/properties |
-[**getThumbnail**](DerivativesApi.md#getThumbnail) | **GET** /modelderivative/v2/designdata/{urn}/thumbnail |
-[**translate**](DerivativesApi.md#translate) | **POST** /modelderivative/v2/designdata/job |
-
-
-
-# **deleteManifest**
-> Result deleteManifest(urn)
-
-
-
-Deletes the manifest and all its translated output files (derivatives). However, it does not delete the design source file.
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **urn** | **String**| The Base64 (URL Safe) encoded design URN |
-
-### Return type
-
-[**Result**](Result.md)
-
-### Authorization
-
-[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
-
-### HTTP request headers
-
- - **Content-Type**: application/x-www-form-urlencoded
- - **Accept**: application/vnd.api+json, application/json
-
-
-# **getDerivativeManifest**
-> getDerivativeManifest(urn, derivativeUrn, range)
-
-
-
-Downloads a selected derivative. To download the file, you need to specify the file’s URN, which you retrieve by calling the [GET {urn}/manifest](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-GET) endpoint. Note that the Model Derivative API uses 2 types of URNs. The **design URN** is generated when you upload the source design file to Forge, and is used when calling most of the Model Derivative endpoints. A **derivative URN** is generated for each translated output file format, and is used for downloading the output design files. You can set the range of bytes that are returned when downloading the derivative, using the range header.
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **urn** | **String**| The Base64 (URL Safe) encoded design URN |
- **derivativeUrn** | **String**| The URL-encoded URN of the derivatives. The URN is retrieved from the GET :urn/manifest endpoint. |
- **range** | **Integer**| This is the standard RFC 2616 range request header. It only supports one range specifier per request: 1. Range:bytes=0-63 (returns the first 64 bytes) 2. Range:bytes=64-127 (returns the second set of 64 bytes) 3. Range:bytes=1022- (returns all the bytes from offset 1022 to the end) 4. If the range header is not specified, the whole content is returned. | [optional]
-
-### Return type
-
-null (empty response body)
-
-### Authorization
-
-[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/octet-stream
-
-
-# **getFormats**
-> Formats getFormats(ifModifiedSince, acceptEncoding)
-
-
-
-Returns an up-to-date list of Forge-supported translations, that you can use to identify which types of derivatives are supported for each source file type. You can set this endpoint to only return the list of supported translations if they have been updated since a specified date. See the [Supported Translation Formats table](https://developer.autodesk.com/en/docs/model-derivative/v2/overview/supported-translations) for more details about supported translations. Note that we are constantly adding new file formats to the list of Forge translations.
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **ifModifiedSince** | **Date**| The supported formats are only returned if they were modified since the specified date. An invalid date returns the latest supported format list. If the supported formats have not been modified since the specified date, the endpoint returns a `NOT MODIFIED` (304) response. | [optional]
- **acceptEncoding** | **String**| If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format. | [optional]
-
-### Return type
-
-[**Formats**](Formats.md)
-
-### Authorization
-
-[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/vnd.api+json, application/json
-
-
-# **getManifest**
-> Manifest getManifest(urn, acceptEncoding)
-
-
-
-Returns information about derivatives that correspond to a specific source file, including derviative URNs and statuses. The URNs of the derivatives are used to download the generated derivatives when calling the [GET {urn}/manifest/{derivativeurn}](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-derivativeurn-GET) endpoint. The statuses are used to verify whether the translation of requested output files is complete. Note that different output files might complete their translation processes at different times, and therefore may have different `status` values. When translating a source file a second time, the previously created manifest is not deleted; it appends the information (only new translations) to the manifest.
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **urn** | **String**| The Base64 (URL Safe) encoded design URN |
- **acceptEncoding** | **String**| If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format. | [optional]
-
-### Return type
-
-[**Manifest**](Manifest.md)
-
-### Authorization
-
-[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/vnd.api+json, application/json
-
-
-# **getMetadata**
-> Metadata getMetadata(urn, acceptEncoding)
-
-
-
-Returns a list of model view (metadata) IDs for a design model. The metadata ID enables end users to select an object tree and properties for a specific model view. Although most design apps (e.g., Fusion and Inventor) only allow a single model view (object tree and set of properties), some apps (e.g., Revit) allow users to design models with multiple model views (e.g., HVAC, architecture, perspective). Note that you can only retrieve metadata from an input file that has been translated into an SVF file.
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **urn** | **String**| The Base64 (URL Safe) encoded design URN |
- **acceptEncoding** | **String**| If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format. | [optional]
-
-### Return type
-
-[**Metadata**](Metadata.md)
-
-### Authorization
-
-[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/vnd.api+json, application/json
-
-
-# **getModelviewMetadata**
-> Metadata getModelviewMetadata(urn, guid, acceptEncoding)
-
-
-
-Returns an object tree, i.e., a hierarchical list of objects for a model view. To call this endpoint you first need to call the [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) endpoint, to determine which model view (object tree and set of properties) to use. Although most design apps (e.g., Fusion and Inventor) only allow a single model view, some apps (e.g., Revit) allow users to design models with multiple model views (e.g., HVAC, architecture, perspective). Note that you can only retrieve metadata from an input file that has been translated into an SVF file.
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **urn** | **String**| The Base64 (URL Safe) encoded design URN |
- **guid** | **String**| Unique model view ID. Call [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) to get the ID |
- **acceptEncoding** | **String**| If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format. | [optional]
-
-### Return type
-
-[**Metadata**](Metadata.md)
-
-### Authorization
-
-[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/vnd.api+json, application/json
-
-
-# **getModelviewProperties**
-> Metadata getModelviewProperties(urn, guid, acceptEncoding)
-
-
-
-Returns a list of properties for each object in an object tree. Properties are returned according to object ID and do not follow a hierarchical structure. The following image displays a typical list of properties for a Revit object:  To call this endpoint you need to first call the [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) endpoint, which returns a list of model view (metadata) IDs for a design input model. Select a model view (metadata) ID to use when calling the Get Properties endpoint. Note that you can only get properties from a design input file that was previously translated into an SVF file.
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **urn** | **String**| The Base64 (URL Safe) encoded design URN |
- **guid** | **String**| Unique model view ID. Call [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) to get the ID |
- **acceptEncoding** | **String**| If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format. | [optional]
-
-### Return type
-
-[**Metadata**](Metadata.md)
-
-### Authorization
-
-[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/vnd.api+json, application/json
-
-
-# **getThumbnail**
-> File getThumbnail(urn, width, height)
-
-
-
-Returns the thumbnail for the source file.
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **urn** | **String**| The Base64 (URL Safe) encoded design URN |
- **width** | **Integer**| The desired width of the thumbnail. Possible values are 100, 200 and 400. | [optional]
- **height** | **Integer**| The desired height of the thumbnail. Possible values are 100, 200 and 400. | [optional]
-
-### Return type
-
-[**File**](File.md)
-
-### Authorization
-
-[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/octet-stream
-
-
-# **translate**
-> Job translate(job, xAdsForce)
-
-
-
-Translate a source file from one format to another. Derivatives are stored in a manifest that is updated each time this endpoint is used on a source file. Note that this endpoint is asynchronous and initiates a process that runs in the background, rather than keeping an open HTTP connection until completion. Use the [GET {urn}/manifest](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-GET) endpoint to poll for the job’s completion.
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **job** | [**JobPayload**](JobPayload.md)| |
- **xAdsForce** | **Boolean**| `true`: the endpoint replaces previously translated output file types with the newly generated derivatives `false` (default): previously created derivatives are not replaced | [optional] [default to false]
-
-### Return type
-
-[**Job**](Job.md)
-
-### Authorization
-
-[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
-
-### HTTP request headers
-
- - **Content-Type**: application/json
- - **Accept**: application/vnd.api+json, application/json
-
+# DerivativesApi
+
+All URIs are relative to *https://developer.api.autodesk.com/*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**deleteManifest**](DerivativesApi.md#deleteManifest) | **DELETE** /modelderivative/v2/designdata/{urn}/manifest |
+[**getDerivativeManifest**](DerivativesApi.md#getDerivativeManifest) | **GET** /modelderivative/v2/designdata/{urn}/manifest/{derivativeUrn} |
+[**getFormats**](DerivativesApi.md#getFormats) | **GET** /modelderivative/v2/designdata/formats |
+[**getManifest**](DerivativesApi.md#getManifest) | **GET** /modelderivative/v2/designdata/{urn}/manifest |
+[**getMetadata**](DerivativesApi.md#getMetadata) | **GET** /modelderivative/v2/designdata/{urn}/metadata |
+[**getModelviewMetadata**](DerivativesApi.md#getModelviewMetadata) | **GET** /modelderivative/v2/designdata/{urn}/metadata/{guid} |
+[**getModelviewProperties**](DerivativesApi.md#getModelviewProperties) | **GET** /modelderivative/v2/designdata/{urn}/metadata/{guid}/properties |
+[**getThumbnail**](DerivativesApi.md#getThumbnail) | **GET** /modelderivative/v2/designdata/{urn}/thumbnail |
+[**translate**](DerivativesApi.md#translate) | **POST** /modelderivative/v2/designdata/job |
+
+
+
+# **deleteManifest**
+> Result deleteManifest(urn)
+
+
+
+Deletes the manifest and all its translated output files (derivatives). However, it does not delete the design source file.
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **urn** | **String**| The Base64 (URL Safe) encoded design URN |
+
+### Return type
+
+[**Result**](Result.md)
+
+### Authorization
+
+[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: application/vnd.api+json, application/json
+
+
+# **getDerivativeManifest**
+> getDerivativeManifest(urn, derivativeUrn, range)
+
+
+
+Downloads a selected derivative. To download the file, you need to specify the file’s URN, which you retrieve by calling the [GET {urn}/manifest](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-GET) endpoint. Note that the Model Derivative API uses 2 types of URNs. The **design URN** is generated when you upload the source design file to Forge, and is used when calling most of the Model Derivative endpoints. A **derivative URN** is generated for each translated output file format, and is used for downloading the output design files. You can set the range of bytes that are returned when downloading the derivative, using the range header.
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **urn** | **String**| The Base64 (URL Safe) encoded design URN |
+ **derivativeUrn** | **String**| The URL-encoded URN of the derivatives. The URN is retrieved from the GET :urn/manifest endpoint. |
+ **range** | **Integer**| This is the standard RFC 2616 range request header. It only supports one range specifier per request: 1. Range:bytes=0-63 (returns the first 64 bytes) 2. Range:bytes=64-127 (returns the second set of 64 bytes) 3. Range:bytes=1022- (returns all the bytes from offset 1022 to the end) 4. If the range header is not specified, the whole content is returned. | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/octet-stream
+
+
+# **getFormats**
+> Formats getFormats(ifModifiedSince, acceptEncoding)
+
+
+
+Returns an up-to-date list of Forge-supported translations, that you can use to identify which types of derivatives are supported for each source file type. You can set this endpoint to only return the list of supported translations if they have been updated since a specified date. See the [Supported Translation Formats table](https://developer.autodesk.com/en/docs/model-derivative/v2/overview/supported-translations) for more details about supported translations. Note that we are constantly adding new file formats to the list of Forge translations.
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **ifModifiedSince** | **Date**| The supported formats are only returned if they were modified since the specified date. An invalid date returns the latest supported format list. If the supported formats have not been modified since the specified date, the endpoint returns a `NOT MODIFIED` (304) response. | [optional]
+ **acceptEncoding** | **String**| If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format. | [optional]
+
+### Return type
+
+[**Formats**](Formats.md)
+
+### Authorization
+
+[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/vnd.api+json, application/json
+
+
+# **getManifest**
+> Manifest getManifest(urn, acceptEncoding)
+
+
+
+Returns information about derivatives that correspond to a specific source file, including derviative URNs and statuses. The URNs of the derivatives are used to download the generated derivatives when calling the [GET {urn}/manifest/{derivativeurn}](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-derivativeurn-GET) endpoint. The statuses are used to verify whether the translation of requested output files is complete. Note that different output files might complete their translation processes at different times, and therefore may have different `status` values. When translating a source file a second time, the previously created manifest is not deleted; it appends the information (only new translations) to the manifest.
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **urn** | **String**| The Base64 (URL Safe) encoded design URN |
+ **acceptEncoding** | **String**| If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format. | [optional]
+
+### Return type
+
+[**Manifest**](Manifest.md)
+
+### Authorization
+
+[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/vnd.api+json, application/json
+
+
+# **getMetadata**
+> Metadata getMetadata(urn, acceptEncoding)
+
+
+
+Returns a list of model view (metadata) IDs for a design model. The metadata ID enables end users to select an object tree and properties for a specific model view. Although most design apps (e.g., Fusion and Inventor) only allow a single model view (object tree and set of properties), some apps (e.g., Revit) allow users to design models with multiple model views (e.g., HVAC, architecture, perspective). Note that you can only retrieve metadata from an input file that has been translated into an SVF file.
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **urn** | **String**| The Base64 (URL Safe) encoded design URN |
+ **acceptEncoding** | **String**| If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format. | [optional]
+
+### Return type
+
+[**Metadata**](Metadata.md)
+
+### Authorization
+
+[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/vnd.api+json, application/json
+
+
+# **getModelviewMetadata**
+> Metadata getModelviewMetadata(urn, guid, acceptEncoding)
+
+
+
+Returns an object tree, i.e., a hierarchical list of objects for a model view. To call this endpoint you first need to call the [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) endpoint, to determine which model view (object tree and set of properties) to use. Although most design apps (e.g., Fusion and Inventor) only allow a single model view, some apps (e.g., Revit) allow users to design models with multiple model views (e.g., HVAC, architecture, perspective). Note that you can only retrieve metadata from an input file that has been translated into an SVF file.
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **urn** | **String**| The Base64 (URL Safe) encoded design URN |
+ **guid** | **String**| Unique model view ID. Call [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) to get the ID |
+ **acceptEncoding** | **String**| If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format. | [optional]
+ **localVarQueryParams** | **List**| If specified, append extra API options to the query string, e.g. the *forceget* option| [optional]
+
+### Return type
+
+[**Metadata**](Metadata.md)
+
+### Authorization
+
+[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/vnd.api+json, application/json
+
+
+# **getModelviewProperties**
+> Metadata getModelviewProperties(urn, guid, acceptEncoding)
+
+
+
+Returns a list of properties for each object in an object tree. Properties are returned according to object ID and do not follow a hierarchical structure. The following image displays a typical list of properties for a Revit object:  To call this endpoint you need to first call the [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) endpoint, which returns a list of model view (metadata) IDs for a design input model. Select a model view (metadata) ID to use when calling the Get Properties endpoint. Note that you can only get properties from a design input file that was previously translated into an SVF file.
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **urn** | **String**| The Base64 (URL Safe) encoded design URN |
+ **guid** | **String**| Unique model view ID. Call [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) to get the ID |
+ **acceptEncoding** | **String**| If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format. | [optional]
+ **localVarQueryParams** | **List**| If specified, append extra API options to the query string, e.g. the *forceget* option| [optional]
+
+### Return type
+
+[**Metadata**](Metadata.md)
+
+### Authorization
+
+[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/vnd.api+json, application/json
+
+
+# **getThumbnail**
+> File getThumbnail(urn, width, height)
+
+
+
+Returns the thumbnail for the source file.
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **urn** | **String**| The Base64 (URL Safe) encoded design URN |
+ **width** | **Integer**| The desired width of the thumbnail. Possible values are 100, 200 and 400. | [optional]
+ **height** | **Integer**| The desired height of the thumbnail. Possible values are 100, 200 and 400. | [optional]
+
+### Return type
+
+[**File**](File.md)
+
+### Authorization
+
+[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/octet-stream
+
+
+# **translate**
+> Job translate(job, xAdsForce)
+
+
+
+Translate a source file from one format to another. Derivatives are stored in a manifest that is updated each time this endpoint is used on a source file. Note that this endpoint is asynchronous and initiates a process that runs in the background, rather than keeping an open HTTP connection until completion. Use the [GET {urn}/manifest](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-GET) endpoint to poll for the job’s completion.
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **job** | [**JobPayload**](JobPayload.md)| |
+ **xAdsForce** | **Boolean**| `true`: the endpoint replaces previously translated output file types with the newly generated derivatives `false` (default): previously created derivatives are not replaced | [optional] [default to false]
+
+### Return type
+
+[**Job**](Job.md)
+
+### Authorization
+
+[oauth2_access_code](../README.md#authentication), [oauth2_application](../README.md#authentication)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/vnd.api+json, application/json
+
diff --git a/pom.xml b/pom.xml
index 0ceecd5..70d1a9c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,206 +1,326 @@
-
- 4.0.0
- com.autodesk
- forge-java-sdk
- jar
- com-autodesk-client
- 1.0.2
-
-
- 2.2.0
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 2.12
-
-
-
- loggerPath
- conf/log4j.properties
-
-
- -Xms512m -Xmx1500m
- methods
- pertest
-
-
-
- maven-dependency-plugin
-
-
- package
-
- copy-dependencies
-
-
- ${project.build.directory}/lib
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- 2.2
-
-
-
- jar
- test-jar
-
-
-
-
-
-
-
-
- org.codehaus.mojo
- build-helper-maven-plugin
- 1.10
-
-
- add_sources
- generate-sources
-
- add-source
-
-
-
- src/main/java
-
-
-
-
- add_test_sources
- generate-test-sources
-
- add-test-source
-
-
-
- src/test/java
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 2.3.2
-
- 1.7
- 1.7
-
-
-
-
-
-
- io.swagger
- swagger-annotations
- ${swagger-annotations-version}
-
-
-
-
- com.sun.jersey
- jersey-client
- ${jersey-version}
-
-
- com.sun.jersey.contribs
- jersey-multipart
- ${jersey-version}
-
-
-
-
- com.fasterxml.jackson.core
- jackson-core
- ${jackson-version}
-
-
- com.fasterxml.jackson.core
- jackson-annotations
- ${jackson-version}
-
-
- com.fasterxml.jackson.core
- jackson-databind
- [2.8.11.1,)
-
-
- com.fasterxml.jackson.jaxrs
- jackson-jaxrs-json-provider
- ${jackson-version}
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-joda
- ${jackson-version}
-
-
- joda-time
- joda-time
- ${jodatime-version}
-
-
-
-
- com.brsanthu
- migbase64
- 2.2
-
-
-
- com.googlecode.json-simple
- json-simple
- 1.1
-
-
-
- org.apache.httpcomponents
- httpclient
- 4.5
-
-
- org.json
- json
- 20160212
-
-
-
-
- junit
- junit
- ${junit-version}
- test
-
-
-
- org.mockito
- mockito-all
- 1.9.5
-
-
-
-
-
- UTF-8
- 1.5.8
- 1.19.1
- 2.8.9
- 2.9.4
- 1.0.0
- 4.12
-
+ 4.0.0
+ com.autodesk
+ forge-java-sdk
+ jar
+ forge-java-sdk
+ SDK of Autodesk Forge
+ https://github.com/Autodesk-Forge/forge-api-java-client
+ 1.0.2
+
+ 2.2.0
+
+
+
+ MIT License
+ http://www.opensource.org/licenses/mit-license.php
+ repo
+
+
+
+
+ Cyrille Fauvel
+ Cyrille.Fauvel@autodesk.com
+ Autodesk
+ https://github.com/cyrillef
+
+ architect
+
+
+
+ Jaime Rosales Duque
+ jaime.rosales.duque@autodesk.com
+ Autodesk
+ https://github.com/jaimerosales/
+
+ developer
+
+
+
+ Augusto Goncalves
+ Augusto.Goncalves@autodesk.com
+ Autodesk
+ https://github.com/augustogoncalves
+
+ developer
+
+
+
+ xiaodongliang
+ xiaodong.liang@autodesk.com
+ Autodesk
+ https://github.com/xiaodongliang
+
+ developer
+
+
+
+
+ https://github.com/Autodesk-Forge/forge-api-java-client
+
+
+
+ ossrh
+ OSS Snapshots Repository
+ https://oss.sonatype.org/content/repositories/snapshots/
+
+
+ ossrh
+ OSS Staging Repository
+ https://oss.sonatype.org/service/local/staging/deploy/maven2/
+
+
+
+
+
+ maven-assembly-plugin
+ 3.0.0
+
+
+ jar-with-dependencies
+
+
+
+ com.example.yourMain
+
+
+
+
+
+ make-assembly
+
+ package
+
+
+ single
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.12
+
+
+
+ loggerPath
+ conf/log4j.properties
+
+
+ -Xms512m -Xmx1500m
+ methods
+ pertest
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}/lib
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 2.2
+
+
+
+ jar
+ test-jar
+
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 1.10
+
+
+ add_sources
+ generate-sources
+
+ add-source
+
+
+
+ src/main/java
+
+
+
+
+ add_test_sources
+ generate-test-sources
+
+ add-test-source
+
+
+
+ src/test/java
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.3
+
+ 1.8
+ 1.8
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.5
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+
+
+
+ io.swagger
+ swagger-annotations
+ ${swagger-annotations-version}
+
+
+
+ com.sun.jersey
+ jersey-client
+ ${jersey-version}
+
+
+ com.sun.jersey.contribs
+ jersey-multipart
+ ${jersey-version}
+
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.jaxrs
+ jackson-jaxrs-json-provider
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-joda
+ ${jackson-version}
+
+
+ joda-time
+ joda-time
+ ${jodatime-version}
+
+
+
+ com.brsanthu
+ migbase64
+ 2.2
+
+
+ com.googlecode.json-simple
+ json-simple
+ 1.1
+
+
+
+ org.apache.httpcomponents
+ httpclient
+ 4.5
+
+
+ org.json
+ json
+ 20160212
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ ${jackson-version}
+
+
+
+ junit
+ junit
+ ${junit-version}
+ test
+
+
+
+ org.mockito
+ mockito-all
+ 1.9.5
+
+
+
+ UTF-8
+ 1.5.8
+ 1.19.1
+ 2.9.8
+ 2.9.4
+ 1.4.0
+ 4.12
+
diff --git a/samples/com/autodesk/samples/Main.java b/samples/com/autodesk/samples/Main.java
index 2f76516..1abe916 100644
--- a/samples/com/autodesk/samples/Main.java
+++ b/samples/com/autodesk/samples/Main.java
@@ -19,16 +19,18 @@
public class Main {
- //TODO - insert your CLIENT_ID and CLIENT_SECRET
- private static final String CLIENT_ID = "";
- private static final String CLIENT_SECRET = "";
+ // TODO - insert your CLIENT_ID and CLIENT_SECRET
+ private static final String CLIENT_ID = "";
+ private static final String CLIENT_SECRET = "";
private static final String BUCKET_KEY = "forge-java-sample-app-" + CLIENT_ID.toLowerCase();
private static final String FILE_NAME = "my-elephant.obj";
private static final String FILE_PATH = "samples/com/autodesk/samples/elephant.obj";
- // Initialize the relevant clients; in this example, the Objects, Buckets and Derivatives clients, which are part of the Data Management API and Model Derivatives API
+ // Initialize the relevant clients; in this example, the Objects, Buckets and
+ // Derivatives clients, which are part of the Data Management API and Model
+ // Derivatives API
private static final BucketsApi bucketsApi = new BucketsApi();
private static final ObjectsApi objectsApi = new ObjectsApi();
private static final DerivativesApi derivativesApi = new DerivativesApi();
@@ -38,6 +40,7 @@ public class Main {
/**
* Initialize the 2-legged OAuth 2.0 client, and optionally set specific scopes.
+ *
* @throws Exception
*/
private static void initializeOAuth() throws Exception {
@@ -49,19 +52,22 @@ private static void initializeOAuth() throws Exception {
scopes.add("bucket:create");
scopes.add("bucket:read");
- //Set autoRefresh to `true` to automatically refresh the access token when it expires.
+ // Set autoRefresh to `true` to automatically refresh the access token when it
+ // expires.
oauth2TwoLegged = new OAuth2TwoLegged(CLIENT_ID, CLIENT_SECRET, scopes, true);
twoLeggedCredentials = oauth2TwoLegged.authenticate();
}
/**
- * Example of how to create a new bucket using Forge SDK.
- * Uses the oauth2TwoLegged and twoLeggedCredentials objects that you retrieved previously.
- * @throws com.autodesk.client.ApiException
+ * Example of how to create a new bucket using Forge SDK. Uses the
+ * oauth2TwoLegged and twoLeggedCredentials objects that you retrieved
+ * previously.
+ *
+ * @throws com.autodesk.client.ApiException
* @throws Exception
*/
private static void createBucket() throws ApiException, Exception {
- System.out.println("***** Sending createBucket request" );
+ System.out.println("***** Sending createBucket request");
PostBucketsPayload payload = new PostBucketsPayload();
payload.setBucketKey(BUCKET_KEY);
payload.setPolicyKey(PostBucketsPayload.PolicyKeyEnum.PERSISTENT);
@@ -70,32 +76,37 @@ private static void createBucket() throws ApiException, Exception {
}
/**
- * Example of how to upload a file to the bucket.
- * Uses the oauth2TwoLegged and twoLeggedCredentials objects that you retrieved previously.
- * @throws java.io.FileNotFoundException
- * @throws com.autodesk.client.ApiException
+ * Example of how to upload a file to the bucket. Uses the oauth2TwoLegged and
+ * twoLeggedCredentials objects that you retrieved previously.
+ *
+ * @throws java.io.FileNotFoundException
+ * @throws com.autodesk.client.ApiException
* @throws Exception
*/
private static ObjectDetails uploadFile() throws FileNotFoundException, ApiException, Exception {
- System.out.println("***** Sending uploadFile request" );
+ System.out.println("***** Sending uploadFile request");
File fileToUpload = new File(FILE_PATH);
- ApiResponse response = objectsApi.uploadObject(BUCKET_KEY, FILE_NAME, (int)fileToUpload.length(), fileToUpload, null, null, oauth2TwoLegged, twoLeggedCredentials);
+ ApiResponse response = objectsApi.uploadObject(BUCKET_KEY, FILE_NAME,
+ (int) fileToUpload.length(), fileToUpload, null, null, oauth2TwoLegged, twoLeggedCredentials);
System.out.println("***** Response for uploadFile: ");
ObjectDetails objectDetails = response.getData();
- System.out.println("Uploaded object Details - Location: " + objectDetails.getLocation() + ", Size:"+objectDetails.getSize());
+ System.out.println("Uploaded object Details - Location: " + objectDetails.getLocation() + ", Size:"
+ + objectDetails.getSize());
return objectDetails;
}
/**
- * Example of how to send a translate to SVF job request.
- * Uses the oauth2TwoLegged and twoLeggedCredentials objects that you retrieved previously.
+ * Example of how to send a translate to SVF job request. Uses the
+ * oauth2TwoLegged and twoLeggedCredentials objects that you retrieved
+ * previously.
+ *
* @param urn - the urn of the file to translate
- * @throws com.autodesk.client.ApiException
+ * @throws com.autodesk.client.ApiException
* @throws Exception
*/
- private static Job translateToSVF(String urn) throws ApiException, Exception{
- System.out.println("***** Sending Derivative API translate request" );
+ private static Job translateToSVF(String urn) throws ApiException, Exception {
+ System.out.println("***** Sending Derivative API translate request");
JobPayload job = new JobPayload();
@@ -113,34 +124,37 @@ private static Job translateToSVF(String urn) throws ApiException, Exception{
job.setInput(input);
job.setOutput(output);
- ApiResponse response = derivativesApi.translate(job,true,oauth2TwoLegged,twoLeggedCredentials);
+ ApiResponse response = derivativesApi.translate(job, true, oauth2TwoLegged, twoLeggedCredentials);
System.out.println("***** Response for Translating File to SVF: " + response.getData());
return response.getData();
}
/**
- * Example of how to query the status of a translate job.
- * Uses the oauth2TwoLegged and twoLeggedCredentials objects that you retrieved previously.
+ * Example of how to query the status of a translate job. Uses the
+ * oauth2TwoLegged and twoLeggedCredentials objects that you retrieved
+ * previously.
+ *
* @param base64Urn - the urn of the file to translate in base 64 format
- * @throws com.autodesk.client.ApiException
+ * @throws com.autodesk.client.ApiException
* @throws Exception
*/
- private static Manifest verifyJobComplete(String base64Urn) throws ApiException, Exception{
- System.out.println("***** Sending getManifest request" );
+ private static Manifest verifyJobComplete(String base64Urn) throws ApiException, Exception {
+ System.out.println("***** Sending getManifest request");
boolean isComplete = false;
ApiResponse response = null;
- while(!isComplete){
- response = derivativesApi.getManifest(base64Urn,null,oauth2TwoLegged,twoLeggedCredentials);
+ while (!isComplete) {
+ response = derivativesApi.getManifest(base64Urn, null, oauth2TwoLegged, twoLeggedCredentials);
Manifest manifest = response.getData();
- if(response.getData().getProgress().equals("complete")){
+ if (response.getData().getProgress().equals("complete")) {
isComplete = true;
- System.out.println("***** Finished translating your file to SVF - status: " + manifest.getStatus() + ", progress:" + manifest.getProgress());
- }
- else{
- System.out.println("***** Haven't finished translating your file to SVF - status: " + manifest.getStatus() + ", progress:" + manifest.getProgress());
- Thread.sleep(1000);
+ System.out.println("***** Finished translating your file to SVF - status: " + manifest.getStatus()
+ + ", progress:" + manifest.getProgress());
+ } else {
+ System.out.println("***** Haven't finished translating your file to SVF - status: "
+ + manifest.getStatus() + ", progress:" + manifest.getProgress());
+ Thread.sleep(2000);
}
}
@@ -149,68 +163,69 @@ private static Manifest verifyJobComplete(String base64Urn) throws ApiException,
}
/**
- * Open translated SVF file in the viewer
- * Uses the twoLeggedCredentials object that you retrieved previously.
- * Opens the file statically from your hard drive with url parameters for the accessToken and for the urn of the file to show.
+ * Open translated SVF file in the viewer Uses the twoLeggedCredentials object
+ * that you retrieved previously. Opens the file statically from your hard drive
+ * with url parameters for the accessToken and for the urn of the file to show.
+ *
* @param base64Urn
* @throws IOException
*/
private static void openViewer(String base64Urn) throws IOException {
System.out.println("***** Opening SVF file in viewer with urn:" + base64Urn);
File htmlFile = new File("samples/com/autodesk/samples/viewer.html");
- UriBuilder builder = UriBuilder.fromPath("file:///" + htmlFile.getAbsolutePath()).queryParam("token",twoLeggedCredentials.getAccessToken()).queryParam("urn",base64Urn);
+ UriBuilder builder = UriBuilder.fromPath("file:///" + htmlFile.getAbsolutePath())
+ .queryParam("token", twoLeggedCredentials.getAccessToken()).queryParam("urn", base64Urn);
Desktop.getDesktop().browse(builder.build());
}
/**
- * Example of how to delete a file that was uploaded by the application.
- * Uses the oauth2TwoLegged and twoLeggedCredentials objects that you retrieved previously.
- * @throws com.autodesk.client.ApiException
+ * Example of how to delete a file that was uploaded by the application. Uses
+ * the oauth2TwoLegged and twoLeggedCredentials objects that you retrieved
+ * previously.
+ *
+ * @throws com.autodesk.client.ApiException
* @throws Exception
*/
- private static void deleteFile() throws ApiException, Exception{
- System.out.println("***** Sending deleteFile request" );
- ApiResponse response = objectsApi.deleteObject(BUCKET_KEY, FILE_NAME, oauth2TwoLegged, twoLeggedCredentials);
+ private static void deleteFile() throws ApiException, Exception {
+ System.out.println("***** Sending deleteFile request");
+ ApiResponse response = objectsApi.deleteObject(BUCKET_KEY, FILE_NAME, oauth2TwoLegged,
+ twoLeggedCredentials);
System.out.println("***** Response Code for deleting File: " + response.getStatusCode());
}
public static void main(String[] args) throws Exception {
- try{
+ try {
initializeOAuth();
- try{
+ try {
createBucket();
- }
- catch (ApiException e){
+ } catch (ApiException e) {
System.err.println("Error creating bucket : " + e.getResponseBody());
}
- try{
+ try {
ObjectDetails uploadedObject = uploadFile();
- try{
+ try {
Job job = translateToSVF(uploadedObject.getObjectId());
- if(job.getResult().equals("success")){
+ if (job.getResult().equals("success")) {
String base64Urn = job.getUrn();
Manifest manifest = verifyJobComplete(base64Urn);
- if (manifest.getStatus().equals("success")){
+ if (manifest.getStatus().equals("success")) {
openViewer(manifest.getUrn());
}
}
- }
- catch (ApiException e){
+ } catch (ApiException e) {
System.err.println("Error translating file : " + e.getResponseBody());
}
- }
- catch (ApiException e){
+ } catch (ApiException e) {
System.err.println("Error uploading file : " + e.getResponseBody());
}
- }
- catch (ApiException e){
+ } catch (ApiException e) {
System.err.println("Error Initializing OAuth client : " + e.getResponseBody());
}
}
diff --git a/samples/com/autodesk/samples/MainMetadata.java b/samples/com/autodesk/samples/MainMetadata.java
index a463d7c..d9745a1 100644
--- a/samples/com/autodesk/samples/MainMetadata.java
+++ b/samples/com/autodesk/samples/MainMetadata.java
@@ -2,6 +2,7 @@
import com.autodesk.client.ApiException;
import com.autodesk.client.ApiResponse;
+import com.autodesk.client.Pair;
import com.autodesk.client.api.BucketsApi;
import com.autodesk.client.api.DerivativesApi;
import com.autodesk.client.api.ObjectsApi;
@@ -18,9 +19,8 @@
import java.util.List;
+
//to test getting metadata and metadata (model view)
-//in order to test the issue at:
-// https://stackoverflow.com/questions/47573466/model-derivative-api-responses-not-mapping-through-jackson/47589522
//simple test without much error checking
//check the first guid of the metadata only
@@ -32,20 +32,18 @@ public class MainMetadata {
private static final String BUCKET_KEY = "forge-java-sample-app-" + CLIENT_ID.toLowerCase();
- private static final String FILE_NAME = "my-elephant.obj";
- private static final String FILE_PATH = "elephant.obj";
-
- //private static final String FILE_NAME = "RevitNative.rvt";
- //private static final String FILE_PATH = "RevitNative.rvt";
-
-
+ // the demo file "rac_basic_sample_project.rvt" can be found at
+ // https://knowledge.autodesk.com/support/revit-products/getting-started/caas/CloudHelp/cloudhelp/2018/ENU/Revit-GetStarted/files/GUID-61EF2F22-3A1F-4317-B925-1E85F138BE88-htm.html
+ private static final String FILE_NAME = "rac_basic_sample_project.rvt";
+ private static final String FILE_PATH = "samples/com/autodesk/samples/rac_basic_sample_project.rvt";
+
private static OAuth2TwoLegged oauth2TwoLegged;
-
+
// Initialize the relevant clients; in this example, the Objects, Buckets and Derivatives clients, which are part of the Data Management API and Model Derivatives API
-
-
+
+
private static final ObjectsApi objectsApi = new ObjectsApi();
-
+
private static final BucketsApi bucketsApi = new BucketsApi();
private static final DerivativesApi derivativesApi = new DerivativesApi();
@@ -67,7 +65,7 @@ private static void initializeOAuth() throws Exception {
//Set autoRefresh to `true` to automatically refresh the access token when it expires.
oauth2TwoLegged = new OAuth2TwoLegged(CLIENT_ID, CLIENT_SECRET, scopes, true);
twoLeggedCredentials = oauth2TwoLegged.authenticate();
-
+
}
/**
@@ -151,72 +149,105 @@ private static Manifest verifyJobComplete(String base64Urn) throws ApiException,
response = derivativesApi.getManifest(base64Urn,null,oauth2TwoLegged,twoLeggedCredentials);
Manifest manifest = response.getData();
if(response.getData().getProgress().equals("complete")){
- isComplete = true;
- System.out.println("***** Finished translating your file to SVF - status: " + manifest.getStatus() + ", progress:" + manifest.getProgress());
+ isComplete = true;
+ System.out.println("***** Finished translating your file to SVF - status: " + manifest.getStatus() + ", progress:" + manifest.getProgress());
}
else{
System.out.println("***** Haven't finished translating your file to SVF - status: " + manifest.getStatus() + ", progress:" + manifest.getProgress());
- }
+ //avoid frequent requests
+ Thread.sleep(2000);
+ }
}
return response.getData();
}
+ /**
+ * Example of how to get guid of specific metadata.
+ * To make it simpler, get the first metadata only.
+ * Uses the oauth2TwoLegged and twoLeggedCredentials objects that you retrieved previously.
+ * @throws com.autodesk.client.ApiException
+ * @throws Exception
+ */
private static Metadata GetMetadata(String base64Urn) throws ApiException, Exception{
System.out.println("***** Sending get Metadata request" );
boolean isComplete = false;
ApiResponse response = null;
response = derivativesApi.getMetadata(base64Urn,
- null,oauth2TwoLegged,twoLeggedCredentials);
- Metadata metadata = response.getData();
+ null,oauth2TwoLegged,twoLeggedCredentials);
+ Metadata metadata = response.getData();
if(response.getStatusCode() == 200){
//assume the first node is what we wanted to check.
String guid = metadata.getData().getMetadata().get(0).getGuid();
- System.out.println("guid: " + guid);
+ System.out.println("guid: " + guid);
GetMetadataForGuid(base64Urn,guid);
- }
+ }
else
{
System.out.println("***** get metadata failed, response code: " + response.getStatusCode());
-
- }
- return response.getData();
+
+ }
+ return response.getData();
}
- private static Metadata GetMetadataForGuid(String base64Urn,String guid) throws ApiException, Exception{
+ /**
+ * Example of how to get specific metadata.
+ * The first HTTP request will respond with 202, which means the extracting of metadata started
+ * Keep querying the same endpoint until it tells 200, then the response includes the metadata.
+ * Uses the oauth2TwoLegged and twoLeggedCredentials objects that you retrieved previously.
+ * @throws com.autodesk.client.ApiException
+ * @throws Exception
+ */
+ private static Metadata GetMetadataForGuid(String base64Urn, String guid) throws ApiException, Exception{
System.out.println("***** Sending get Metadata (Model View) for guid" );
boolean isComplete = false;
ApiResponse response = null;
- while(!isComplete) {
+ List queryParams = null;
+
+ while(!isComplete) {
+
response = derivativesApi.getModelviewMetadata(base64Urn,
- guid,
- "gzip",oauth2TwoLegged,twoLeggedCredentials);
- Metadata metadata = response.getData();
-
+ guid,
+ "gzip",queryParams,oauth2TwoLegged,twoLeggedCredentials);
+
+ Metadata metadata = response.getData();
+
if(response.getStatusCode() == 200){
- isComplete = true;
- System.out.println("***** Metadata (Model View): ");
- System.out.println(metadata.toString());
+ isComplete = true;
+ System.out.println("***** Metadata (Model View): ");
+ System.out.println(metadata.toString());
+ }
+ else if(response.getStatusCode() == 202) {
+ System.out.println("***** (202) Waiting for Model View Preparation: ");
+ Thread.sleep(2000);
}
- else if(response.getStatusCode() == 202) {
- System.out.println("***** (202) Waiting for Model View Preparation: ");
+ else if(response.getStatusCode() == 413) {
+ System.out.println("***** (413) : Request Entity Too Large. Now request with ");
+ System.out.println("***** (413) : Request Entity Too Large.");
+
+ //with 'forgeget'
+ if(queryParams == null)
+ queryParams = new ArrayList();
+ if(!queryParams.contains(new Pair("forceget","true")))
+ queryParams.add(new Pair("forceget","true"));
+ Thread.sleep(2000);
}
else
{
- isComplete = true;
+ isComplete = true;
System.out.println("***** Get Metadata (Model View) failed ");
-
- }
+
+ }
}
return response.getData();
-
+
}
/**
@@ -229,10 +260,10 @@ else if(response.getStatusCode() == 202) {
private static void openViewer(String base64Urn) throws IOException {
System.out.println("***** Opening SVF file in viewer with urn:" + base64Urn);
File htmlFile = new File("samples/com/autodesk/samples/viewer.html");
- UriBuilder builder = UriBuilder.fromPath("file:///" + htmlFile.getAbsolutePath() +
- "?token=" + twoLeggedCredentials.getAccessToken() + "&urn="+base64Urn);
- //Desktop.getDesktop().browse("file:///" + htmlFile.getAbsolutePath() +
- // "?token=" + twoLeggedCredentials.getAccessToken() + "&urn="+base64Urn);
+ UriBuilder builder = UriBuilder.fromPath("file:///" + htmlFile.getAbsolutePath() +
+ "?token=" + twoLeggedCredentials.getAccessToken() + "&urn="+base64Urn);
+ //Desktop.getDesktop().browse("file:///" + htmlFile.getAbsolutePath() +
+ // "?token=" + twoLeggedCredentials.getAccessToken() + "&urn="+base64Urn);
}
/**
@@ -270,7 +301,8 @@ public static void main(String[] args) throws Exception {
Manifest manifest = verifyJobComplete(base64Urn);
if (manifest.getStatus().equals("success")){
- GetMetadata(base64Urn);
+ GetMetadata(base64Urn);
+ //This test
//openViewer(manifest.getUrn());
}
}
diff --git a/samples/com/autodesk/samples/README.MD b/samples/com/autodesk/samples/README.MD
index 6793bcf..e88795e 100644
--- a/samples/com/autodesk/samples/README.MD
+++ b/samples/com/autodesk/samples/README.MD
@@ -23,12 +23,16 @@ Clone the following repository:
### Configure the Parameters
-Open the *Main.java* file, and replace `CLIENT_ID` and `CLIENT_SECRET` with the client ID and client secret generated when creating the app.
+Open the *Main.java* file or *MainMetadata.java* file, and replace `CLIENT_ID` and `CLIENT_SECRET` with the client ID and client secret generated when creating the app.
+The demo file **rac_basic_sample_project.rvt** can be found at https://knowledge.autodesk.com/support/revit-products/getting-started/caas/CloudHelp/cloudhelp/2018/ENU/Revit-GetStarted/files/GUID-61EF2F22-3A1F-4317-B925-1E85F138BE88-htm.html.
+Download it and put into the same folder. Or use your own model.
Note that depending on your IDE, you might need to mark the *samples* directory as the source root directory.
### Run the App
Run the app from your IDE console.
+To test MetaData of a model,
+
## Support
forge.help@autodesk.com
diff --git a/samples/com/autodesk/samples/RevitNative.rvt b/samples/com/autodesk/samples/RevitNative.rvt
deleted file mode 100644
index f25ff2d..0000000
Binary files a/samples/com/autodesk/samples/RevitNative.rvt and /dev/null differ
diff --git a/samples/com/autodesk/samples/viewer.html b/samples/com/autodesk/samples/viewer.html
index 00d93e9..02c4a10 100644
--- a/samples/com/autodesk/samples/viewer.html
+++ b/samples/com/autodesk/samples/viewer.html
@@ -3,7 +3,7 @@
-
+