File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
tomcat/src/main/java/org/apache/coyote/http11 Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ private Optional<URL> findFileURL(String resourcePath) {
24
24
}
25
25
return Optional .of (resourceURL );
26
26
} catch (URISyntaxException e ) {
27
- throw new RuntimeException ( e );
27
+ return Optional . empty ( );
28
28
}
29
29
}
30
30
@@ -37,7 +37,7 @@ public String resourceBodyOf(String resourcePath) {
37
37
}
38
38
throw new IllegalArgumentException ("파일이 존재하지 않습니다." );
39
39
} catch (IOException e ) {
40
- throw new RuntimeException ( e ) ;
40
+ return null ;
41
41
}
42
42
}
43
43
Original file line number Diff line number Diff line change 5
5
6
6
public interface Controller {
7
7
8
- Response handle (Request request );
8
+ Response < Object > handle (Request request );
9
9
}
Original file line number Diff line number Diff line change 6
6
public class Cookies {
7
7
8
8
private static final String SESSION_COOKIE = "JSESSIONID" ;
9
- private Map <String , String > cookies ;
9
+ private final Map <String , String > cookieValues ;
10
10
11
- public Cookies (Map <String , String > cookies ) {
12
- this .cookies = cookies ;
11
+ public Cookies (Map <String , String > cookieValues ) {
12
+ this .cookieValues = cookieValues ;
13
13
}
14
14
15
15
public Optional <String > getCookieOf (String cookieName ) {
16
- if (!cookies .containsKey (cookieName )) {
16
+ if (!cookieValues .containsKey (cookieName )) {
17
17
return Optional .empty ();
18
18
}
19
- return Optional .of (cookies .get (cookieName ));
19
+ return Optional .of (cookieValues .get (cookieName ));
20
20
}
21
21
22
22
public Optional <String > getSessionCookie () {
23
- if (!cookies .containsKey (SESSION_COOKIE )) {
23
+ if (!cookieValues .containsKey (SESSION_COOKIE )) {
24
24
return Optional .empty ();
25
25
}
26
- return Optional .of (cookies .get (SESSION_COOKIE ));
26
+ return Optional .of (cookieValues .get (SESSION_COOKIE ));
27
27
}
28
28
}
You can’t perform that action at this time.
0 commit comments