public final class LocalOfficeUtils extends Object
| 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 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 @NonNull File |
getOfficeExecutable(@NonNull File officeHome)
Gets the office executable within an office installation.
|
static @NonNull com.sun.star.beans.PropertyValue |
property(@NonNull String name,
@NonNull Object value)
Creates a
PropertyValue with the specified name and value. |
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 an 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.
|
static void |
validateOfficeWorkingDirectory(@NonNull File workingDir)
Validates that the specified File instance is a valid office working directory.
|
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 File getDefaultOfficeHome()
File instance that is the directory where lives the first detected office
installation.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.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 property(@NonNull String name, @NonNull Object value)
PropertyValue with the specified name and value.name - The property name.value - The property value.PropertyValue.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 an 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.public static void validateOfficeWorkingDirectory(@NonNull File workingDir)
workingDir - The directory to validate.IllegalStateException - If the specified directory if not a valid office working
directory.Copyright © 2016 - present; JODConverter.org. All rights reserved.