I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 184b6179 authored by zzz's avatar zzz
Browse files

i2psnark: Sync field access (findbugs)

parent 6fccfc99
No related branches found
No related tags found
No related merge requests found
...@@ -157,12 +157,15 @@ class BasicServlet extends HttpServlet ...@@ -157,12 +157,15 @@ class BasicServlet extends HttpServlet
*/ */
public File getResource(String pathInContext) public File getResource(String pathInContext)
{ {
if (_resourceBase==null)
return null;
File r = null; File r = null;
if (!pathInContext.contains("..") && if (!pathInContext.contains("..") &&
!pathInContext.endsWith("/")) { !pathInContext.endsWith("/")) {
File f = new File(_resourceBase, pathInContext); File f;
synchronized (this) {
if (_resourceBase==null)
return null;
f = new File(_resourceBase, pathInContext);
}
if (f.exists()) if (f.exists())
r = f; r = f;
} }
...@@ -178,8 +181,6 @@ class BasicServlet extends HttpServlet ...@@ -178,8 +181,6 @@ class BasicServlet extends HttpServlet
*/ */
public HttpContent getContent(String pathInContext) public HttpContent getContent(String pathInContext)
{ {
if (_resourceBase==null)
return null;
HttpContent r = null; HttpContent r = null;
if (_warBase != null && pathInContext.startsWith(_warBase)) { if (_warBase != null && pathInContext.startsWith(_warBase)) {
r = new JarContent(pathInContext); r = new JarContent(pathInContext);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment