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:
@@ -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());
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user