Class AppCmd
- java.lang.Object
-
- com._1c.g5.v8.dt.platform.services.core.publication.iis.AppCmd
-
public class AppCmd extends Object
IISAppCmd
utility support class.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addApplication(String name, Path location)
Registers a web application with the provided name and location.void
addWebExtension(Path location)
Register 1C:Enterprise web extension component with the provided location.void
configureApplicationWebExtension(String name, Path webExtension)
Configures the path to the registered 1C:Enterprise web extension component for an application with the provided name.boolean
containsApplication(String name)
Returns whether an application with the provided name is registered.void
editApplication(String oldName, String newName, Path location)
Edits a web application with the provided name.static Optional<AppCmd>
find()
Finds and returns local installed systemAppCmd
utility.List<String>
getAllApplicationNames()
Returns a collection of all registered web applications.Optional<Path>
getApplicationConfiguredWebExtension(String name)
Returns a path to the registered 1C:Enterprise web extension component for an application with the provided name.Optional<Path>
getApplicationLocationPath(String name)
Returns an application physical locaion path for the registered application with the provided name.Optional<URL>
getApplicationUrl(String name)
Returns anURL
of the application with the provided name.Optional<String>
getApplicationWebPath(String name)
Returns an application web path for the registered application with the provided name.List<Path>
getWebExtensions()
Returns a collection of all registered 1C:Enterprise web extension component locations.boolean
hasApplicationDefaultDocument(String name, String documentName)
Returns whether the application with the provided name has the default document with the provided name.void
removeApplication(String name)
Removes a web application with the provided name.void
setApplicationDefaultDocument(String name, String documentName)
Sets the default document name for the application with the provided name.
-
-
-
Constructor Detail
-
AppCmd
public AppCmd(Path path)
Creates a new instance ofAppCmd
utility support class for the provided utility location path.- Parameters:
path
- the utility location path, cannot benull
-
-
Method Detail
-
find
public static Optional<AppCmd> find()
Finds and returns local installed systemAppCmd
utility. May not find ulitily in some cases:- If environment variable
%systemroot%
is not exist. - If the system
AppCmd
utility is not installed. - If the system
AppCmd
utility is not executable.
- Returns:
- an optional of local installed system
AppCmd
utility
- If environment variable
-
addApplication
public void addApplication(String name, Path location) throws IOException
Registers a web application with the provided name and location.- Parameters:
name
- the application name, cannot benull
location
- the application location, cannot benull
- Throws:
IOException
- if utility result read error occurred
-
editApplication
public void editApplication(String oldName, String newName, Path location) throws IOException
Edits a web application with the provided name.- Parameters:
oldName
- the old application name, cannot benull
newName
- the new application name, cannot benull
location
- the application location, cannot benull
- Throws:
IOException
- if utility result read error occurred
-
containsApplication
public boolean containsApplication(String name) throws IOException
Returns whether an application with the provided name is registered.- Parameters:
name
- the application name, cannot benull
- Returns:
- whether an application with the provided name is registered
- Throws:
IOException
- if utility result read error occurred
-
configureApplicationWebExtension
public void configureApplicationWebExtension(String name, Path webExtension) throws IOException
Configures the path to the registered 1C:Enterprise web extension component for an application with the provided name.- Parameters:
name
- the application name, cannot benull
webExtension
- the location of the 1C:Enterprise web extension component, cannot benull
- Throws:
IOException
- if utility result read error occurred
-
getApplicationConfiguredWebExtension
public Optional<Path> getApplicationConfiguredWebExtension(String name) throws IOException
Returns a path to the registered 1C:Enterprise web extension component for an application with the provided name.- Parameters:
name
- the application name, cannot benull
- Returns:
- a path to the registered 1C:Enterprise web extension component for an application with the provided name
- Throws:
IOException
- if utility result read error occurred
-
getAllApplicationNames
public List<String> getAllApplicationNames() throws IOException
Returns a collection of all registered web applications.- Returns:
- a collection of all registered web applications
- Throws:
IOException
- if utility result read error occurred
-
getApplicationUrl
public Optional<URL> getApplicationUrl(String name) throws IOException
Returns anURL
of the application with the provided name.- Parameters:
name
- the application name, cannot benull
- Returns:
- an
URL
of the application with the provided name - Throws:
IOException
- if utility result read error occurred
-
getApplicationWebPath
public Optional<String> getApplicationWebPath(String name) throws IOException
Returns an application web path for the registered application with the provided name.- Parameters:
name
- the application name, cannot benull
- Returns:
- an application web path for the registered application with the provided name
- Throws:
IOException
- if utility result read error occurred
-
getApplicationLocationPath
public Optional<Path> getApplicationLocationPath(String name) throws IOException
Returns an application physical locaion path for the registered application with the provided name.- Parameters:
name
- the application name, cannot benull
- Returns:
- an application physical locaion path for the registered application with the provided name
- Throws:
IOException
- if utility result read error occurred
-
removeApplication
public void removeApplication(String name) throws IOException
Removes a web application with the provided name.- Parameters:
name
- the application name, cannot benull
- Throws:
IOException
- if utility result read error occurred
-
getWebExtensions
public List<Path> getWebExtensions() throws IOException
Returns a collection of all registered 1C:Enterprise web extension component locations.- Returns:
- a collection of all registered 1C:Enterprise web extension component locations
- Throws:
IOException
- if utility result read error occurred
-
addWebExtension
public void addWebExtension(Path location) throws IOException
Register 1C:Enterprise web extension component with the provided location.- Parameters:
location
- the application location, cannot benull
- Throws:
IOException
- if utility result read error occurred
-
setApplicationDefaultDocument
public void setApplicationDefaultDocument(String name, String documentName) throws IOException
Sets the default document name for the application with the provided name.- Parameters:
name
- the application name, cannot benull
documentName
- the document name, cannot benull
- Throws:
IOException
- if utility result read error occurred
-
hasApplicationDefaultDocument
public boolean hasApplicationDefaultDocument(String name, String documentName) throws IOException
Returns whether the application with the provided name has the default document with the provided name.- Parameters:
name
- the application name, cannot benull
documentName
- the document name, cannot benull
- Returns:
- whether the application with the provided name has the default document with the provided name
- Throws:
IOException
- if utility result read error occurred
-
-