Class AutoImporter
Program
imports automatically (without requiring user interaction)-
Method Summary
Modifier and TypeMethodDescriptionimportAsBinary
(ByteProvider bytes, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) Automatically imports the givenByteProvider
bytes with theBinaryLoader
, using the given language and compiler specification.importAsBinary
(File file, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) Automatically imports the givenFile
with theBinaryLoader
, using the given language and compiler specification.static LoadResults
<Program> importByLookingForLcs
(FSRL fsrl, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults
<Program> importByLookingForLcs
(File file, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults
<Program> importByUsingBestGuess
(ByteProvider provider, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults
<Program> importByUsingBestGuess
(FSRL fsrl, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults
<Program> importByUsingBestGuess
(File file, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults
<Program> importByUsingSpecificLoaderClass
(FSRL fsrl, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults
<Program> importByUsingSpecificLoaderClass
(File file, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults
<Program> importByUsingSpecificLoaderClassAndLcs
(FSRL fsrl, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults
<Program> importByUsingSpecificLoaderClassAndLcs
(File file, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults
<Program> importFresh
(ByteProvider provider, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor, Predicate<Loader> loaderFilter, LoadSpecChooser loadSpecChooser, String importNameOverride, OptionChooser optionChooser) Automatically imports the givenbytes
with advanced options.static LoadResults
<Program> importFresh
(FSRL fsrl, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor, Predicate<Loader> loaderFilter, LoadSpecChooser loadSpecChooser, String importNameOverride, OptionChooser optionChooser) Automatically imports the givenFSRL
with advanced options.static LoadResults
<Program> importFresh
(File file, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor, Predicate<Loader> loaderFilter, LoadSpecChooser loadSpecChooser, String importNameOverride, OptionChooser optionChooser) Automatically imports the givenFile
with advanced options.
-
Method Details
-
importByUsingBestGuess
public static LoadResults<Program> importByUsingBestGuess(File file, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenFile
with the best matchingLoader
for theFile
's format.Note that when the import completes, the returned
Loaded
Program
s are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)
).It is also the responsibility of the caller to release the returned
Loaded
Program
s withLoadResults.release(Object)
when they are no longer needed.- Parameters:
file
- TheFile
to importproject
- TheProject
. Loaders can use this to take advantage of existingDomainFolder
s andDomainFile
s to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath
- A suggested project folder path for theLoaded
Program
s. This is just a suggestion, and aLoader
implementation reserves the right to change it for eachLoaded
result. TheLoaded
results should be queried for their true project folder paths usingLoaded.getProjectFolderPath()
.consumer
- A consumermessageLog
- The logmonitor
- A task monitor- Returns:
- The
LoadResults
which contains one ore moreLoaded
Program
s (created but not saved) - Throws:
IOException
- if there was an IO-related problem loadingCancelledException
- if the operation was cancelledDuplicateNameException
- if the load resulted in aProgram
naming conflictInvalidNameException
- if an invalidProgram
name was used during loadVersionException
- if there was an issue with database versions, probably due to a failed language upgradeLoadException
- if nothing was loaded
-
importByUsingBestGuess
public static LoadResults<Program> importByUsingBestGuess(FSRL fsrl, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenFSRL
with the best matchingLoader
for theFile
's format.Note that when the import completes, the returned
Loaded
Program
s are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)
).It is also the responsibility of the caller to release the returned
Loaded
Program
s withLoadResults.release(Object)
when they are no longer needed.- Parameters:
fsrl
- TheFSRL
to importproject
- TheProject
. Loaders can use this to take advantage of existingDomainFolder
s andDomainFile
s to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath
- A suggested project folder path for theLoaded
Program
s. This is just a suggestion, and aLoader
implementation reserves the right to change it for eachLoaded
result. TheLoaded
results should be queried for their true project folder paths usingLoaded.getProjectFolderPath()
.consumer
- A consumermessageLog
- The logmonitor
- A task monitor- Returns:
- The
LoadResults
which contains one ore moreLoaded
Program
s (created but not saved) - Throws:
IOException
- if there was an IO-related problem loadingCancelledException
- if the operation was cancelledDuplicateNameException
- if the load resulted in aProgram
naming conflictInvalidNameException
- if an invalidProgram
name was used during loadVersionException
- if there was an issue with database versions, probably due to a failed language upgradeLoadException
- if nothing was loaded
-
importByUsingBestGuess
public static LoadResults<Program> importByUsingBestGuess(ByteProvider provider, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givebytes
with the best matchingLoader
for theByteProvider
's format.Note that when the import completes, the returned
Loaded
Program
s are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)
).It is also the responsibility of the caller to release the returned
Loaded
Program
s withLoadResults.release(Object)
when they are no longer needed.- Parameters:
provider
- The bytes to importproject
- TheProject
. Loaders can use this to take advantage of existingDomainFolder
s andDomainFile
s to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath
- A suggested project folder path for theLoaded
Program
s. This is just a suggestion, and aLoader
implementation reserves the right to change it for eachLoaded
result. TheLoaded
results should be queried for their true project folder paths usingLoaded.getProjectFolderPath()
.consumer
- A consumermessageLog
- The logmonitor
- A task monitor- Returns:
- The
LoadResults
which contains one ore moreLoaded
Program
s (created but not saved) - Throws:
IOException
- if there was an IO-related problem loadingCancelledException
- if the operation was cancelledDuplicateNameException
- if the load resulted in aProgram
naming conflictInvalidNameException
- if an invalidProgram
name was used during loadVersionException
- if there was an issue with database versions, probably due to a failed language upgradeLoadException
- if nothing was loaded
-
importByUsingSpecificLoaderClass
public static LoadResults<Program> importByUsingSpecificLoaderClass(File file, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadExceptionAutomatically imports the givenFile
with the given type ofLoader
.Note that when the import completes, the returned
Loaded
Program
s are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)
).It is also the responsibility of the caller to release the returned
Loaded
Program
s withLoadResults.release(Object)
when they are no longer needed.- Parameters:
file
- TheFile
to importproject
- TheProject
. Loaders can use this to take advantage of existingDomainFolder
s andDomainFile
s to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath
- A suggested project folder path for theLoaded
Program
s. This is just a suggestion, and aLoader
implementation reserves the right to change it for eachLoaded
result. TheLoaded
results should be queried for their true project folder paths usingLoaded.getProjectFolderPath()
.loaderClass
- TheLoader
class to useloaderArgs
- AList
of optionalLoader
-specific argumentsconsumer
- A consumermessageLog
- The logmonitor
- A task monitor- Returns:
- The
LoadResults
which contains one ore moreLoaded
Program
s (created but not saved) - Throws:
IOException
- if there was an IO-related problem loadingCancelledException
- if the operation was cancelledDuplicateNameException
- if the load resulted in aProgram
naming conflictInvalidNameException
- if an invalidProgram
name was used during loadVersionException
- if there was an issue with database versions, probably due to a failed language upgradeLoadException
- if nothing was loaded
-
importByUsingSpecificLoaderClass
public static LoadResults<Program> importByUsingSpecificLoaderClass(FSRL fsrl, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadExceptionAutomatically imports the givenFSRL
with the given type ofLoader
.Note that when the import completes, the returned
Loaded
Program
s are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)
).It is also the responsibility of the caller to release the returned
Loaded
Program
s withLoadResults.release(Object)
when they are no longer needed.- Parameters:
fsrl
- TheFSRL
to importproject
- TheProject
. Loaders can use this to take advantage of existingDomainFolder
s andDomainFile
s to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath
- A suggested project folder path for theLoaded
Program
s. This is just a suggestion, and aLoader
implementation reserves the right to change it for eachLoaded
result. TheLoaded
results should be queried for their true project folder paths usingLoaded.getProjectFolderPath()
.loaderClass
- TheLoader
class to useloaderArgs
- AList
of optionalLoader
-specific argumentsconsumer
- A consumermessageLog
- The logmonitor
- A task monitor- Returns:
- The
LoadResults
which contains one ore moreLoaded
Program
s (created but not saved) - Throws:
IOException
- if there was an IO-related problem loadingCancelledException
- if the operation was cancelledDuplicateNameException
- if the load resulted in aProgram
naming conflictInvalidNameException
- if an invalidProgram
name was used during loadVersionException
- if there was an issue with database versions, probably due to a failed language upgradeLoadException
- if nothing was loaded
-
importByLookingForLcs
public static LoadResults<Program> importByLookingForLcs(File file, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenFile
with the best matchingLoader
that supports the given language and compiler specification.Note that when the import completes, the returned
Loaded
Program
s are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)
).It is also the responsibility of the caller to release the returned
Loaded
Program
s withLoadResults.release(Object)
when they are no longer needed.- Parameters:
file
- TheFile
to importproject
- TheProject
. Loaders can use this to take advantage of existingDomainFolder
s andDomainFile
s to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath
- A suggested project folder path for theLoaded
Program
s. This is just a suggestion, and aLoader
implementation reserves the right to change it for eachLoaded
result. TheLoaded
results should be queried for their true project folder paths usingLoaded.getProjectFolderPath()
.language
- The desiredLanguage
compilerSpec
- The desiredcompiler specification
consumer
- A consumermessageLog
- The logmonitor
- A task monitor- Returns:
- The
LoadResults
which contains one ore moreLoaded
Program
s (created but not saved) - Throws:
IOException
- if there was an IO-related problem loadingCancelledException
- if the operation was cancelledDuplicateNameException
- if the load resulted in aProgram
naming conflictInvalidNameException
- if an invalidProgram
name was used during loadVersionException
- if there was an issue with database versions, probably due to a failed language upgradeLoadException
- if nothing was loaded
-
importByLookingForLcs
public static LoadResults<Program> importByLookingForLcs(FSRL fsrl, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenFSRL
with the best matchingLoader
that supports the given language and compiler specification.Note that when the import completes, the returned
Loaded
Program
s are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)
).It is also the responsibility of the caller to release the returned
Loaded
Program
s withLoadResults.release(Object)
when they are no longer needed.- Parameters:
fsrl
- TheFSRL
to importproject
- TheProject
. Loaders can use this to take advantage of existingDomainFolder
s andDomainFile
s to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath
- A suggested project folder path for theLoaded
Program
s. This is just a suggestion, and aLoader
implementation reserves the right to change it for eachLoaded
result. TheLoaded
results should be queried for their true project folder paths usingLoaded.getProjectFolderPath()
.language
- The desiredLanguage
compilerSpec
- The desiredcompiler specification
consumer
- A consumermessageLog
- The logmonitor
- A task monitor- Returns:
- The
LoadResults
which contains one ore moreLoaded
Program
s (created but not saved) - Throws:
IOException
- if there was an IO-related problem loadingCancelledException
- if the operation was cancelledDuplicateNameException
- if the load resulted in aProgram
naming conflictInvalidNameException
- if an invalidProgram
name was used during loadVersionException
- if there was an issue with database versions, probably due to a failed language upgradeLoadException
- if nothing was loaded
-
importByUsingSpecificLoaderClassAndLcs
public static LoadResults<Program> importByUsingSpecificLoaderClassAndLcs(File file, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionExceptionAutomatically imports the givenFile
with the given type ofLoader
, language, and compiler specification.Note that when the import completes, the returned
Loaded
Program
s are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)
).It is also the responsibility of the caller to release the returned
Loaded
Program
s withLoadResults.release(Object)
when they are no longer needed.- Parameters:
file
- TheFile
to importproject
- TheProject
. Loaders can use this to take advantage of existingDomainFolder
s andDomainFile
s to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath
- A suggested project folder path for theLoaded
Program
s. This is just a suggestion, and aLoader
implementation reserves the right to change it for eachLoaded
result. TheLoaded
results should be queried for their true project folder paths usingLoaded.getProjectFolderPath()
.loaderClass
- TheLoader
class to useloaderArgs
- AList
of optionalLoader
-specific argumentslanguage
- The desiredLanguage
compilerSpec
- The desiredcompiler specification
consumer
- A consumermessageLog
- The logmonitor
- A task monitor- Returns:
- The
LoadResults
which contains one ore moreLoaded
Program
s (created but not saved) - Throws:
IOException
- if there was an IO-related problem loadingCancelledException
- if the operation was cancelledDuplicateNameException
- if the load resulted in aProgram
naming conflictInvalidNameException
- if an invalidProgram
name was used during loadVersionException
- if there was an issue with database versions, probably due to a failed language upgrade
-
importByUsingSpecificLoaderClassAndLcs
public static LoadResults<Program> importByUsingSpecificLoaderClassAndLcs(FSRL fsrl, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionExceptionAutomatically imports the givenFSRL
with the given type ofLoader
, language, and compiler specification.Note that when the import completes, the returned
Loaded
Program
s are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)
).It is also the responsibility of the caller to release the returned
Loaded
Program
s withLoadResults.release(Object)
when they are no longer needed.- Parameters:
fsrl
- TheFSRL
to importproject
- TheProject
. Loaders can use this to take advantage of existingDomainFolder
s andDomainFile
s to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath
- A suggested project folder path for theLoaded
Program
s. This is just a suggestion, and aLoader
implementation reserves the right to change it for eachLoaded
result. TheLoaded
results should be queried for their true project folder paths usingLoaded.getProjectFolderPath()
.loaderClass
- TheLoader
class to useloaderArgs
- AList
of optionalLoader
-specific argumentslanguage
- The desiredLanguage
compilerSpec
- The desiredcompiler specification
consumer
- A consumermessageLog
- The logmonitor
- A task monitor- Returns:
- The
LoadResults
which contains one ore moreLoaded
Program
s (created but not saved) - Throws:
IOException
- if there was an IO-related problem loadingCancelledException
- if the operation was cancelledDuplicateNameException
- if the load resulted in aProgram
naming conflictInvalidNameException
- if an invalidProgram
name was used during loadVersionException
- if there was an issue with database versions, probably due to a failed language upgrade
-
importAsBinary
public static Loaded<Program> importAsBinary(File file, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenFile
with theBinaryLoader
, using the given language and compiler specification.Note that when the import completes, the returned
Loaded
Program
is not saved to a project. That is the responsibility of the caller (seeLoaded.save(Project, MessageLog, TaskMonitor)
).It is also the responsibility of the caller to release the returned
Loaded
Program
withLoaded.release(Object)
when it is no longer needed.- Parameters:
file
- TheFile
to importproject
- TheProject
. Loaders can use this to take advantage of existingDomainFolder
s andDomainFile
s to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath
- A suggested project folder path for theLoaded
Program
. This is just a suggestion, and aLoader
implementation reserves the right to change it for theLoaded
result. TheLoaded
result should be queried for its true project folder paths usingLoaded.getProjectFolderPath()
.language
- The desiredLanguage
compilerSpec
- The desiredcompiler specification
consumer
- A consumermessageLog
- The logmonitor
- A task monitor- Returns:
- The
Loaded
Program
(created but not saved) - Throws:
IOException
- if there was an IO-related problem loadingCancelledException
- if the operation was cancelledDuplicateNameException
- if the load resulted in aProgram
naming conflictInvalidNameException
- if an invalidProgram
name was used during loadVersionException
- if there was an issue with database versions, probably due to a failed language upgradeLoadException
- if nothing was loaded
-
importAsBinary
public static Loaded<Program> importAsBinary(ByteProvider bytes, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenByteProvider
bytes with theBinaryLoader
, using the given language and compiler specification.Note that when the import completes, the returned
Loaded
Program
is not saved to a project. That is the responsibility of the caller (seeLoaded.save(Project, MessageLog, TaskMonitor)
).It is also the responsibility of the caller to release the returned
Loaded
Program
withLoaded.release(Object)
when it is no longer needed.- Parameters:
bytes
- The bytes to importproject
- TheProject
. Loaders can use this to take advantage of existingDomainFolder
s andDomainFile
s to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath
- A suggested project folder path for theLoaded
Program
. This is just a suggestion, and aLoader
implementation reserves the right to change it theLoaded
result. TheLoaded
result should be queried for its true project folder paths usingLoaded.getProjectFolderPath()
.language
- The desiredLanguage
compilerSpec
- The desiredcompiler specification
consumer
- A consumermessageLog
- The logmonitor
- A task monitor- Returns:
- The
Loaded
Program
(created but not saved) - Throws:
IOException
- if there was an IO-related problem loadingCancelledException
- if the operation was cancelledDuplicateNameException
- if the load resulted in aProgram
naming conflictInvalidNameException
- if an invalidProgram
name was used during loadVersionException
- if there was an issue with database versions, probably due to a failed language upgradeLoadException
- if nothing was loaded
-
importFresh
public static LoadResults<Program> importFresh(File file, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor, Predicate<Loader> loaderFilter, LoadSpecChooser loadSpecChooser, String importNameOverride, OptionChooser optionChooser) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenFile
with advanced options.Note that when the import completes, the returned
Loaded
Program
s are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)
).It is also the responsibility of the caller to release the returned
Loaded
Program
s withLoadResults.release(Object)
when they are no longer needed.- Parameters:
file
- TheFile
to importproject
- TheProject
. Loaders can use this to take advantage of existingDomainFolder
s andDomainFile
s to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath
- A suggested project folder path for theLoaded
Program
s. This is just a suggestion, and aLoader
implementation reserves the right to change it for eachLoaded
result. TheLoaded
results should be queried for their true project folder paths usingLoaded.getProjectFolderPath()
.consumer
- A consumermessageLog
- The logmonitor
- A task monitorloaderFilter
- APredicate
used to choose whatLoader
(s) get usedloadSpecChooser
- ALoadSpecChooser
used to choose whatLoadSpec
(s) get usedimportNameOverride
- The name to use for the imported thing. Null to use theLoader
's preferred name.optionChooser
- AOptionChooser
used to choose whatLoader
options get used- Returns:
- The
LoadResults
which contains one ore moreLoaded
Program
s (created but not saved) - Throws:
IOException
- if there was an IO-related problem loadingCancelledException
- if the operation was cancelledDuplicateNameException
- if the load resulted in aProgram
naming conflictInvalidNameException
- if an invalidProgram
name was used during loadVersionException
- if there was an issue with database versions, probably due to a failed language upgradeLoadException
- if nothing was loaded
-
importFresh
public static LoadResults<Program> importFresh(FSRL fsrl, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor, Predicate<Loader> loaderFilter, LoadSpecChooser loadSpecChooser, String importNameOverride, OptionChooser optionChooser) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenFSRL
with advanced options.Note that when the import completes, the returned
Loaded
Program
s are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)
).It is also the responsibility of the caller to release the returned
Loaded
Program
s withLoadResults.release(Object)
when they are no longer needed.- Parameters:
fsrl
- TheFSRL
to importproject
- TheProject
. Loaders can use this to take advantage of existingDomainFolder
s andDomainFile
s to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath
- A suggested project folder path for theLoaded
Program
s. This is just a suggestion, and aLoader
implementation reserves the right to change it for eachLoaded
result. TheLoaded
results should be queried for their true project folder paths usingLoaded.getProjectFolderPath()
.consumer
- A consumermessageLog
- The logmonitor
- A task monitorloaderFilter
- APredicate
used to choose whatLoader
(s) get usedloadSpecChooser
- ALoadSpecChooser
used to choose whatLoadSpec
(s) get usedimportNameOverride
- The name to use for the imported thing. Null to use theLoader
's preferred name.optionChooser
- AOptionChooser
used to choose whatLoader
options get used- Returns:
- The
LoadResults
which contains one ore moreLoaded
Program
s (created but not saved) - Throws:
IOException
- if there was an IO-related problem loadingCancelledException
- if the operation was cancelledDuplicateNameException
- if the load resulted in aProgram
naming conflictInvalidNameException
- if an invalidProgram
name was used during loadVersionException
- if there was an issue with database versions, probably due to a failed language upgradeLoadException
- if nothing was loaded
-
importFresh
public static LoadResults<Program> importFresh(ByteProvider provider, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor, Predicate<Loader> loaderFilter, LoadSpecChooser loadSpecChooser, String importNameOverride, OptionChooser optionChooser) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenbytes
with advanced options.Note that when the import completes, the returned
Loaded
Program
s are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)
).It is also the responsibility of the caller to release the returned
Loaded
Program
s withLoadResults.release(Object)
when they are no longer needed.- Parameters:
provider
- The bytes to importproject
- TheProject
. Loaders can use this to take advantage of existingDomainFolder
s andDomainFile
s to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath
- A suggested project folder path for theLoaded
Program
s. This is just a suggestion, and aLoader
implementation reserves the right to change it for eachLoaded
result. TheLoaded
results should be queried for their true project folder paths usingLoaded.getProjectFolderPath()
.consumer
- A consumermessageLog
- The logmonitor
- A task monitorloaderFilter
- APredicate
used to choose whatLoader
(s) get usedloadSpecChooser
- ALoadSpecChooser
used to choose whatLoadSpec
(s) get usedimportNameOverride
- The name to use for the imported thing. Null to use theLoader
's preferred name.optionChooser
- AOptionChooser
used to choose whatLoader
options get used- Returns:
- The
LoadResults
which contains one ore moreLoaded
Program
s (created but not saved) - Throws:
IOException
- if there was an IO-related problem loadingCancelledException
- if the operation was cancelledDuplicateNameException
- if the load resulted in aProgram
naming conflictInvalidNameException
- if an invalidProgram
name was used during loadVersionException
- if there was an issue with database versions, probably due to a failed language upgradeLoadException
- if nothing was loaded
-