Moved getExtension back to FileUtil
This commit is contained in:
parent
a68c79182d
commit
3916f2cd1d
|
@ -1,5 +1,21 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 dorkbox, llc
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package dorkbox.systemTray;
|
package dorkbox.systemTray;
|
||||||
|
|
||||||
|
import dorkbox.util.FileUtil;
|
||||||
import dorkbox.util.LocationResolver;
|
import dorkbox.util.LocationResolver;
|
||||||
import dorkbox.util.OS;
|
import dorkbox.util.OS;
|
||||||
|
|
||||||
|
@ -18,13 +34,10 @@ import java.util.HashMap;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public
|
public
|
||||||
class ImageUtil {
|
class ImageUtil {
|
||||||
|
|
||||||
private static final File TEMP_DIR = new File(System.getProperty("java.io.tmpdir"));
|
public static final File TEMP_DIR = new File(System.getProperty("java.io.tmpdir"));
|
||||||
|
|
||||||
private static MessageDigest digest;
|
private static MessageDigest digest;
|
||||||
|
|
||||||
|
@ -159,12 +172,12 @@ class ImageUtil {
|
||||||
// can be wimpy, only one at a time
|
// can be wimpy, only one at a time
|
||||||
String hash = hashName(bytes);
|
String hash = hashName(bytes);
|
||||||
|
|
||||||
String extension = "";
|
String extension = FileUtil.getExtension(cacheName);
|
||||||
int dot = cacheName.lastIndexOf('.');
|
if (extension == null) {
|
||||||
if (dot > -1) {
|
extension = "";
|
||||||
extension = cacheName.substring(dot + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
newFile = new File(TEMP_DIR, "SYSTRAY_" + hash + '.' + extension).getAbsoluteFile();
|
newFile = new File(TEMP_DIR, "SYSTRAY_" + hash + '.' + extension).getAbsoluteFile();
|
||||||
if (SystemTray.isKDE) {
|
if (SystemTray.isKDE) {
|
||||||
// KDE is unique per run, so this prevents buildup
|
// KDE is unique per run, so this prevents buildup
|
||||||
|
|
Loading…
Reference in New Issue
Block a user