1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-14 10:16:21 +00:00

#79: Change background and logo image

This commit is contained in:
jendib
2016-05-08 17:25:21 +02:00
parent f5394534f7
commit 4d79dd7076
13 changed files with 153 additions and 32 deletions

View File

@@ -72,7 +72,7 @@ public class AppContext {
eventBus = new EventBus();
eventBus.register(new DeadEventListener());
asyncExecutorList = new ArrayList<ExecutorService>();
asyncExecutorList = new ArrayList<>();
asyncEventBus = newAsyncEventBus();
asyncEventBus.register(new FileCreatedAsyncListener());

View File

@@ -86,6 +86,15 @@ public class DirectoryUtil {
return getDataSubDirectory("log");
}
/**
* Returns the theme directory.
*
* @return Theme directory.
*/
public static Path getThemeDirectory() {
return getDataSubDirectory("theme");
}
/**
* Returns a subdirectory of the base data directory
*

View File

@@ -1,5 +1,6 @@
package com.sismics.util.mime;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
@@ -21,16 +22,16 @@ public class MimeTypeUtil {
*
* @param is Stream to inspect
* @return MIME type
* @throws Exception
* @throws IOException
*/
public static String guessMimeType(InputStream is) throws Exception {
public static String guessMimeType(InputStream is) throws IOException {
byte[] headerBytes = new byte[64];
is.mark(headerBytes.length);
int readCount = is.read(headerBytes);
is.reset();
if (readCount <= 0) {
throw new Exception("Cannot read input file");
throw new IOException("Cannot read input file");
}
return guessMimeType(headerBytes);