public final class UpdaterUtil extends Object
net.imagej.updater package and
subpackages.
Class functionality:
| Modifier and Type | Field and Description |
|---|---|
static char[] |
hex |
static String |
MAIN_URL |
static String |
PREFS_USER |
static String |
SSH_HOST |
static String |
UPDATE_DIRECTORY |
static String |
XML_COMPRESSED |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canExecute(File file) |
static long |
currentTimestamp() |
static MessageDigest |
getDigest() |
static String |
getDigest(String path,
File file) |
static String |
getJarDigest(File file) |
static String |
getJarDigest(File file,
boolean treatPropertiesSpecially,
boolean treatManifestsSpecially) |
static String |
getJarDigest(File file,
boolean treatPropertiesSpecially,
boolean treatManifestsSpecially,
boolean keepOnlyMainClassInManifest) |
static long |
getLastModified(URL url) |
static org.scijava.log.LogService |
getLogService()
Get a log service.
|
static List<String> |
getObsoleteDigests(String path,
File file)
Handle previous methods to calculate the checksums gracefully Earlier, we
simply checksummed all the contents in .jar files.
|
static String |
getPlatform()
Deprecated.
Use
Platforms.current() instead. |
static long |
getTimestamp(File file) |
static boolean |
isGPRActivated(File ijRoot)
Determines whether the ImageJ root directory has been moved to an area
dictated by macOS's Gatekeeper Path Randomization feature.
|
static boolean |
isProtectedLocation(File ijRoot)
Determines whether the ImageJ root directory is in an area protected by the OS.
|
static <T> Iterable<T> |
iterate(Enumeration<T> en) |
static <T> String |
join(String delimiter,
Iterable<T> list) |
static URLConnection |
openConnection(URL url)
Open a connection to a
URL. |
static InputStream |
openStream(URL url)
Open a stream to a
URL. |
static boolean |
patchInfoPList(File infoPList,
String executable) |
static String |
prettyPrintTimestamp(long timestamp) |
protected static String |
readFile(File file) |
static byte[] |
readStreamAsBytes(InputStream input) |
static String |
stripPrefix(String string,
String prefix) |
static String |
stripSuffix(String string,
String suffix) |
static String |
timestamp(Calendar date) |
static String |
timestamp(long millis) |
static long |
timestamp2millis(long timestamp) |
static long |
timestamp2millis(String timestamp) |
static String |
toCamelCase(String string)
CamelCases a
String. |
static String |
toHex(byte[] bytes) |
static void |
updateDigest(InputStream input,
MessageDigest digest) |
static void |
useSystemProxies() |
protected static void |
writeFile(File file,
String contents) |
public static String MAIN_URL
public static String UPDATE_DIRECTORY
public static String SSH_HOST
public static final String XML_COMPRESSED
public static final String PREFS_USER
public static final char[] hex
@Deprecated public static String getPlatform()
Platforms.current() instead.public static String getDigest(String path, File file) throws NoSuchAlgorithmException, FileNotFoundException, IOException, UnsupportedEncodingException
public static MessageDigest getDigest() throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic static List<String> getObsoleteDigests(String path, File file) throws FileNotFoundException, IOException
path - the path relative to the ImageJ directoryfile - the fileIOExceptionFileNotFoundExceptionpublic static void updateDigest(InputStream input, MessageDigest digest) throws IOException
IOExceptionpublic static String toHex(byte[] bytes)
public static String getJarDigest(File file) throws FileNotFoundException, IOException
FileNotFoundExceptionIOExceptionpublic static String getJarDigest(File file, boolean treatPropertiesSpecially, boolean treatManifestsSpecially) throws FileNotFoundException, IOException
FileNotFoundExceptionIOExceptionpublic static String getJarDigest(File file, boolean treatPropertiesSpecially, boolean treatManifestsSpecially, boolean keepOnlyMainClassInManifest) throws FileNotFoundException, IOException
FileNotFoundExceptionIOExceptionpublic static long currentTimestamp()
public static long getTimestamp(File file)
public static String timestamp(long millis)
public static long timestamp2millis(long timestamp)
public static long timestamp2millis(String timestamp)
public static String prettyPrintTimestamp(long timestamp)
public static void useSystemProxies()
public static long getLastModified(URL url)
public static InputStream openStream(URL url) throws IOException
URL.url - the URL to openIOExceptionpublic static URLConnection openConnection(URL url) throws IOException
URL.url - the URL to openIOExceptionpublic static byte[] readStreamAsBytes(InputStream input) throws IOException
IOExceptionprotected static String readFile(File file) throws IOException
IOExceptionprotected static void writeFile(File file, String contents) throws IOException
IOExceptionpublic static boolean canExecute(File file)
public static boolean isGPRActivated(File ijRoot)
ijRoot - the root directory to testpublic static boolean isProtectedLocation(File ijRoot)
On Windows Vista and later, C:\Program Files is a protected location.
ijRoot - the root directory to testpublic static boolean patchInfoPList(File infoPList, String executable) throws IOException
IOExceptionpublic static <T> Iterable<T> iterate(Enumeration<T> en)
public static org.scijava.log.LogService getLogService()
StderrLogService cannot be found).Copyright © 2009–2025 ImageJ. All rights reserved.