Skip to content

Commit 8f083d4

Browse files
committed
Format and put import back
1 parent 792dd35 commit 8f083d4

File tree

3 files changed

+28
-25
lines changed

3 files changed

+28
-25
lines changed

io/src/main/java/org/red5/io/amf/Output.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.red5.io.object.RecordSet;
3232
import org.red5.io.object.Serializer;
3333
import org.red5.io.utils.XMLUtils;
34+
import org.red5.resource.Red5Root;
3435
import org.red5.resource.RootResolutionException;
3536
import org.slf4j.Logger;
3637
import org.slf4j.LoggerFactory;
@@ -75,10 +76,10 @@ private static CacheManager getCacheManager() {
7576
CREATE_CACHE_MANAGER: if (cacheManager == null) {
7677
String red5Root = null;
7778
try {
78-
red5Root = Red5Root.get();
79-
} catch (RootResolutionException e) {
80-
log.debug("",e);
81-
}
79+
red5Root = Red5Root.get();
80+
} catch (RootResolutionException e) {
81+
log.debug("", e);
82+
}
8283

8384
if (red5Root != null) {
8485
Path conf = Paths.get(red5Root, "conf", "ehcache.xml");

io/src/main/java/org/red5/resource/Red5Root.java

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
* @author Andy Shaules
1616
*/
1717
public class Red5Root {
18-
19-
protected static Logger log = LoggerFactory.getLogger(Red5Root.class);
20-
18+
19+
protected static Logger log = LoggerFactory.getLogger(Red5Root.class);
20+
2121
private static final String PropertyRed5Root = "red5.root";
2222

2323
private static final String VarRed5Home = "RED5_HOME";
@@ -30,11 +30,12 @@ public class Red5Root {
3030

3131
private static ReentrantLock lookupLock = new ReentrantLock();
3232

33-
private static ThreadLocal<Throwable> lastError = ThreadLocal.withInitial(()->null);
33+
private static ThreadLocal<Throwable> lastError = ThreadLocal.withInitial(() -> null);
34+
3435
/**
35-
* Get Root directory of server.
36+
* Get Root directory of server.
3637
* @return String path or throws exception.
37-
* @throws RootResolutionException if server root cannot be resolved.
38+
* @throws RootResolutionException if server root cannot be resolved.
3839
*/
3940
public static String get() throws RootResolutionException {
4041
if (homeDirectory == null) {
@@ -48,15 +49,15 @@ public static String get() throws RootResolutionException {
4849
}
4950
}
5051
if (homeDirectory == null) {
51-
if(lastError.get()!=null) {
52-
try {
53-
throw new RootResolutionException("Server root path cannot be resolved from system/env properties or code location.",lastError.get());
54-
}finally {
55-
lastError.remove();
56-
}
57-
}else {
58-
throw new RootResolutionException("Server root path cannot be resolved from system/env properties or code location.");
59-
}
52+
if (lastError.get() != null) {
53+
try {
54+
throw new RootResolutionException("Server root path cannot be resolved from system/env properties or code location.", lastError.get());
55+
} finally {
56+
lastError.remove();
57+
}
58+
} else {
59+
throw new RootResolutionException("Server root path cannot be resolved from system/env properties or code location.");
60+
}
6061
}
6162
return homeDirectory;
6263
}
@@ -97,7 +98,7 @@ private static String resolve() {
9798
try {
9899
return Paths.get(location.toURI());
99100
} catch (Exception e) {
100-
log.warn("",e);
101+
log.warn("", e);
101102
// Wrap URI-specific issues
102103
throw new RuntimeException("Failed to convert URL to URI", e);
103104
}
@@ -108,8 +109,8 @@ private static String resolve() {
108109
}
109110
} catch (Throwable t) {
110111
//Catch everything possible
111-
lastError.set(t);//Bubble it to the caller gracefully.
112-
log.debug("",t);
112+
lastError.set(t);//Bubble it to the caller gracefully.
113+
log.debug("", t);
113114
}
114115
return path;
115116
}

io/src/main/java/org/red5/resource/RootResolutionException.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package org.red5.resource;
2+
23
/**
3-
* Exception thrown when server directory cannot be resolved.
4+
* Exception thrown when server directory cannot be resolved.
45
* @author Andy Shaules
56
*/
67
public class RootResolutionException extends Exception {
78

8-
private static final long serialVersionUID = 2412009315006073537L;
9+
private static final long serialVersionUID = 2412009315006073537L;
910

10-
public RootResolutionException(String message) {
11+
public RootResolutionException(String message) {
1112
super(message);
1213
}
1314

0 commit comments

Comments
 (0)