public class FilesCollection extends LinkedHashMap<String,FileObject> implements Iterable<FileObject>
FileObject
s.Modifier and Type | Class and Description |
---|---|
static class |
FilesCollection.DependencyMap |
static interface |
FilesCollection.Filter |
static class |
FilesCollection.FilteredIterator |
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Field and Description |
---|---|
protected List<Conflicts.Conflict> |
conflicts |
static String |
DEFAULT_UPDATE_SITE |
protected Set<FileObject> |
ignoredConflicts |
LogService |
log |
UpdaterUtil |
util |
Constructor and Description |
---|
FilesCollection(File imagejRoot)
This constructor takes the imagejRoot primarily for testing purposes.
|
FilesCollection(LogService log,
File imagejRoot)
This constructor takes the imagejRoot primarily for testing purposes.
|
clear, containsValue, entrySet, forEach, getOrDefault, keySet, removeEldestEntry, replaceAll, values
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace, size
equals, hashCode
finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace, size
public static final String DEFAULT_UPDATE_SITE
public final LogService log
protected Set<FileObject> ignoredConflicts
protected List<Conflicts.Conflict> conflicts
public final UpdaterUtil util
public FilesCollection(File imagejRoot)
imagejRoot
- the ImageJ directorypublic FilesCollection(LogService log, File imagejRoot)
log
- the log serviceimagejRoot
- the ImageJ directorypublic UpdateSite addUpdateSite(String name, String url, String sshHost, String uploadDirectory, long timestamp)
public UpdateSite addUpdateSite(UpdateSite site)
protected void addUpdateSite(String name, UpdateSite updateSite)
public void removeUpdateSite(String name)
public void replaceUpdateSites(List<UpdateSite> sites)
@Deprecated public UpdateSite getUpdateSite(String name)
getUpdateSite(String, boolean)
insteadpublic UpdateSite getUpdateSite(String name, boolean evenDisabled)
@Deprecated public Collection<String> getUpdateSiteNames()
getUpdateSiteNames(boolean)
insteadpublic Collection<String> getUpdateSiteNames(boolean evenDisabled)
public Collection<UpdateSite> getUpdateSites(boolean evenDisabled)
public Collection<String> getSiteNamesToUpload()
public boolean hasUploadableSites()
public boolean hasUpdateSitesChanges()
public void setUpdateSitesChanged(boolean updateSitesChanged)
public int deactivateUpdateSite(UpdateSite site)
site
- the site to deactivatepublic void activateUpdateSite(UpdateSite updateSite, Progress progress) throws ParserConfigurationException, IOException, SAXException
updateSite
- the update site to activateprogress
- the object to display the progressParserConfigurationException
IOException
SAXException
public void reReadUpdateSite(String name, Progress progress) throws ParserConfigurationException, IOException, SAXException
public String protocolsMissingUploaders(UploaderService uploaderService, Progress progress)
public Set<GroupAction> getValidActions()
public Set<GroupAction> getValidActions(Iterable<FileObject> selected)
@Deprecated public FileObject.Action[] getActions(FileObject file)
@Deprecated public FileObject.Action[] getActions(Iterable<FileObject> files)
public void read() throws IOException, ParserConfigurationException, SAXException
public void read(File file) throws IOException, ParserConfigurationException, SAXException
public void read(FileInputStream in) throws IOException, ParserConfigurationException, SAXException
public void write() throws IOException, SAXException, TransformerConfigurationException
public FilesCollection clone(Iterable<FileObject> iterable)
public Iterable<FileObject> toUploadOrRemove()
public Iterable<FileObject> toUpload()
public Iterable<FileObject> toUpload(boolean includeMetadataChanges)
public Iterable<FileObject> toUpload(String updateSite)
public Iterable<FileObject> toUninstall()
public Iterable<FileObject> toRemove()
public Iterable<FileObject> toUpdate()
public Iterable<FileObject> upToDate()
public Iterable<FileObject> toInstall()
public Iterable<FileObject> toInstallOrUpdate()
public Iterable<FileObject> notHidden()
public Iterable<FileObject> uninstalled()
public Iterable<FileObject> installed()
public Iterable<FileObject> locallyModified()
public Iterable<FileObject> forUpdateSite(String name)
public Iterable<FileObject> forUpdateSite(String name, boolean includeObsoletes)
public Iterable<FileObject> managedFiles()
public Iterable<FileObject> localOnly()
public Iterable<FileObject> shownByDefault()
public Iterable<FileObject> uploadable()
public Iterable<FileObject> uploadable(boolean assumeModified)
assumeModified
- true if we want the potentially uploadable files if
they (or their metadata) were to be changed.public Iterable<FileObject> changes()
public static Iterable<FileObject> filter(FilesCollection.Filter filter, Iterable<FileObject> files)
public static Iterable<FileObject> filter(String search, Iterable<FileObject> files)
public FilesCollection.Filter yes()
public FilesCollection.Filter doesPlatformMatch()
public FilesCollection.Filter is(FileObject.Action action)
public FilesCollection.Filter isNoAction()
public FilesCollection.Filter oneOf(FileObject.Action... actions)
public FilesCollection.Filter is(FileObject.Status status)
public FilesCollection.Filter hasMetadataChanges()
public FilesCollection.Filter isUpdateSite(String updateSite)
public FilesCollection.Filter oneOf(FileObject.Status... states)
public FilesCollection.Filter startsWith(String prefix)
public FilesCollection.Filter startsWith(String... prefixes)
public FilesCollection.Filter endsWith(String suffix)
public FilesCollection.Filter not(FilesCollection.Filter filter)
public FilesCollection.Filter or(FilesCollection.Filter a, FilesCollection.Filter b)
public FilesCollection.Filter and(FilesCollection.Filter a, FilesCollection.Filter b)
public Iterable<FileObject> filter(FilesCollection.Filter filter)
public FileObject getFileFromDigest(String filename, String digest)
public Iterable<String> analyzeDependencies(FileObject file)
public void updateDependencies(FileObject file)
public boolean has(FilesCollection.Filter filter)
public boolean hasChanges()
public boolean hasUploadOrRemove()
public boolean hasForcableUpdates()
public Iterable<FileObject> updateable(boolean evenForcedOnes)
public void markForUpdate(boolean evenForcedUpdates)
public String getURL(FileObject file)
public FilesCollection.DependencyMap getDependencies(boolean overridingOnes)
overridingOnes
- whether to include files that override a particular dependencypublic FilesCollection.DependencyMap getDependencies(Iterable<FileObject> files, boolean overridingOnes)
files
- the dependenciesoverridingOnes
- whether to include files that override a particular dependencypublic void sort()
public String checkConsistency()
public File prefix(FileObject file)
public boolean fileExists(String filename)
public String toString()
toString
in class AbstractMap<String,FileObject>
@Deprecated public FileObject get(int index)
public void add(FileObject file)
public FileObject get(Object filename)
get
in interface Map<String,FileObject>
get
in class LinkedHashMap<String,FileObject>
public FileObject put(String key, FileObject file)
put
in interface Map<String,FileObject>
put
in class HashMap<String,FileObject>
public FileObject remove(Object file)
remove
in interface Map<String,FileObject>
remove
in class HashMap<String,FileObject>
public Iterator<FileObject> iterator()
iterator
in interface Iterable<FileObject>
public void tryLoadingCollection() throws ParserConfigurationException, SAXException
public String downloadIndexAndChecksum(Progress progress) throws ParserConfigurationException, SAXException
public List<Conflicts.Conflict> getConflicts()
public static String getInstalledVersions(File ijDirectory, Progress progress)
public Collection<String> getProtocols(Iterable<FileObject> selected)
Copyright © 2014–2022 ImageJ. All rights reserved.