public final class LocalOfficeUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT |
| Modifier and Type | Method and Description |
|---|---|
static @NonNull List<org.jodconverter.local.office.OfficeUrl> |
buildOfficeUrls(@Nullable List<Integer> portNumbers,
@Nullable List<String> pipeNames)
Builds an array of
OfficeUrl from an array of port numbers and an array of pipe names. |
static @NonNull List<org.jodconverter.local.office.OfficeUrl> |
buildOfficeUrls(@Nullable String host,
@Nullable List<Integer> portNumbers,
@Nullable List<String> pipeNames)
Builds an array of
OfficeUrl from an array of port numbers and an array of pipe names. |
static @NonNull ProcessManager |
findBestProcessManager()
Find the best process manager that will be used to retrieve a process PID and to kill a process
by PID.
|
static @NonNull File |
getDefaultOfficeHome()
Gets the default office home directory, which is auto-detected.
|
static @NonNull org.jodconverter.core.document.DocumentFamily |
getDocumentFamily(@NonNull com.sun.star.lang.XComponent document)
Gets the
DocumentFamily of the specified document. |
static @Nullable org.jodconverter.core.document.DocumentFamily |
getDocumentFamilySilently(@NonNull com.sun.star.lang.XComponent document)
Gets the
DocumentFamily of the specified document, without throwing an exception if not
found. |
static @NonNull File |
getOfficeExecutable(@NonNull File officeHome)
Gets the office executable within an office installation.
|
static @NonNull com.sun.star.beans.PropertyValue[] |
toUnoProperties(@NonNull Map<String,Object> properties)
Converts a regular java map to an array of
PropertyValue, usable as arguments with UNO
interface types. |
static @NonNull String |
toUrl(@NonNull File file)
Constructs a URL from the specified file as expected by office.
|
static void |
validateOfficeHome(@NonNull File officeHome)
Validates that the specified File instance is a valid office home directory.
|
static void |
validateOfficeTemplateProfileDirectory(@Nullable File templateProfileDir)
Validates that the specified File instance is a valid office template profile directory.
|
public static final int DEFAULT_PORT
public static @NonNull ProcessManager findBestProcessManager()
public static @NonNull List<org.jodconverter.local.office.OfficeUrl> buildOfficeUrls(@Nullable List<Integer> portNumbers, @Nullable List<String> pipeNames)
OfficeUrl from an array of port numbers and an array of pipe names.portNumbers - The port numbers from which office URLs will be created, may be null.pipeNames - The pipe names from which office URLs will be created, may be null.public static @NonNull List<org.jodconverter.local.office.OfficeUrl> buildOfficeUrls(@Nullable String host, @Nullable List<Integer> portNumbers, @Nullable List<String> pipeNames)
OfficeUrl from an array of port numbers and an array of pipe names.host - The host to which open ports belong, may be null.portNumbers - The port numbers from which office URLs will be created, may be null.pipeNames - The pipe names from which office URLs will be created, may be null.public static @NonNull File getDefaultOfficeHome()
File instance that is the directory where lives the first detected office
installation.public static @Nullable org.jodconverter.core.document.DocumentFamily getDocumentFamilySilently(@NonNull com.sun.star.lang.XComponent document)
DocumentFamily of the specified document, without throwing an exception if not
found.document - The document whose family will be returned. Must not be null.DocumentFamily for the specified document, or null if the document
does not represent any supported document family.public static @NonNull org.jodconverter.core.document.DocumentFamily getDocumentFamily(@NonNull com.sun.star.lang.XComponent document)
throws org.jodconverter.core.office.OfficeException
DocumentFamily of the specified document.document - The document whose family will be returned. Must not be null.DocumentFamily for the specified document.org.jodconverter.core.office.OfficeException - If the document family cannot be retrieved.public static @NonNull File getOfficeExecutable(@NonNull File officeHome)
officeHome - The root (home) directory of the office installation.public static @NonNull com.sun.star.beans.PropertyValue[] toUnoProperties(@NonNull Map<String,Object> properties)
PropertyValue, usable as arguments with UNO
interface types.properties - The map to convert.PropertyValue.public static @NonNull String toUrl(@NonNull File file)
file - The file for which a URL will be constructed.public static void validateOfficeHome(@NonNull File officeHome)
officeHome - The home to validate.IllegalStateException - If the specified directory if not a valid office home
directory.public static void validateOfficeTemplateProfileDirectory(@Nullable File templateProfileDir)
templateProfileDir - The directory to validate.IllegalStateException - If the specified directory if not a valid office template
profile directory.Copyright © 2022 - present; JODConverter. All rights reserved.