Class CloudSdk
- java.lang.Object
-
- com.google.cloud.tools.appengine.operations.CloudSdk
-
public class CloudSdk extends Object
Cloud SDK CLI wrapper.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CloudSdk.Builder
-
Field Summary
Fields Modifier and Type Field Description static CloudSdkVersion
MINIMUM_VERSION
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Path
getAppEngineSdkForJavaPath()
Returns the directory containing JAR files bundled with the Cloud SDK.Path
getAppEngineToolsJar()
Locates appengine-tools-api.jar.Path
getGCloudPath()
Get an OS specific path to gcloud.Path
getJarPath(String jarName)
Gets the file system location for an SDK jar.Path
getJavaHomePath()
Path
getPath()
CloudSdkVersion
getVersion()
Returns the version of the Cloud SDK installation.void
validateAppEngineJavaComponents()
Checks whether the App Engine Java components are installed in the expected location in the Cloud SDK.void
validateCloudSdk()
Checks whether the Cloud SDK path and version are valid.void
validateJdk()
Checks whether the configured Java home path is a valid JDK.
-
-
-
Field Detail
-
MINIMUM_VERSION
public static final CloudSdkVersion MINIMUM_VERSION
-
-
Method Detail
-
getVersion
public CloudSdkVersion getVersion() throws CloudSdkVersionFileException
Returns the version of the Cloud SDK installation. Version is determined by reading the VERSION file located in the Cloud SDK directory.- Throws:
CloudSdkVersionFileException
-
getPath
public Path getPath()
-
getGCloudPath
public Path getGCloudPath()
Get an OS specific path to gcloud.
-
getAppEngineSdkForJavaPath
public Path getAppEngineSdkForJavaPath()
Returns the directory containing JAR files bundled with the Cloud SDK.- Returns:
- the directory containing JAR files bundled with the Cloud SDK
-
getJavaHomePath
public Path getJavaHomePath()
-
getJarPath
@Nullable public Path getJarPath(String jarName)
Gets the file system location for an SDK jar.- Parameters:
jarName
- the jar file name. For example, "servlet-api.jar"- Returns:
- the path in the file system
-
validateCloudSdk
public void validateCloudSdk() throws CloudSdkNotFoundException, CloudSdkOutOfDateException, CloudSdkVersionFileException
Checks whether the Cloud SDK path and version are valid.- Throws:
CloudSdkNotFoundException
- when Cloud SDK is not installed where expectedCloudSdkOutOfDateException
- when Cloud SDK is out of dateCloudSdkVersionFileException
- VERSION file could not be read
-
validateJdk
public void validateJdk() throws InvalidJavaSdkException
Checks whether the configured Java home path is a valid JDK.- Throws:
InvalidJavaSdkException
- See Also:
getJavaHomePath()
-
validateAppEngineJavaComponents
public void validateAppEngineJavaComponents() throws AppEngineJavaComponentsNotInstalledException
Checks whether the App Engine Java components are installed in the expected location in the Cloud SDK.- Throws:
AppEngineJavaComponentsNotInstalledException
- when the App Engine Java components are not installed in the Cloud SDK
-
getAppEngineToolsJar
public Path getAppEngineToolsJar()
Locates appengine-tools-api.jar.
-
-