1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.waarp.gateway.kernel.session;
21
22 import org.waarp.common.command.NextCommandReply;
23 import org.waarp.common.file.SessionInterface;
24
25
26
27
28
29
30
31
32 public class DefaultHttpAuth implements HttpAuthInterface {
33
34
35
36 protected String user = "user";
37
38
39
40
41 protected String password = "password";
42
43
44
45
46 protected String account = "account";
47
48
49
50
51 protected final boolean isIdentified;
52
53
54
55
56 protected final SessionInterface session;
57
58
59
60
61 public DefaultHttpAuth(final SessionInterface session) {
62 this.session = session;
63 isIdentified = true;
64 }
65
66 @Override
67 public final SessionInterface getSession() {
68 return session;
69 }
70
71 @Override
72 public final NextCommandReply setUser(final String user) {
73 this.user = user;
74 return null;
75 }
76
77 @Override
78 public final String getUser() {
79 return user;
80 }
81
82 @Override
83 public final NextCommandReply setPassword(final String password) {
84 this.password = password;
85 return null;
86 }
87
88 @Override
89 public final boolean isIdentified() {
90 return isIdentified;
91 }
92
93 @Override
94 public final boolean isAdmin() {
95 return false;
96 }
97
98 @Override
99 public final boolean isBusinessPathValid(final String newPath) {
100 return true;
101 }
102
103 @Override
104 public final String getBusinessPath() {
105 return "";
106 }
107
108 @Override
109 public final String getBaseDirectory() {
110 return "/";
111 }
112
113 @Override
114 public final String getRelativePath(final String file) {
115 return file;
116 }
117
118 @Override
119 public final void clear() {
120
121 }
122
123 @Override
124 public final String getAccount() {
125 return account;
126 }
127
128 @Override
129 public final NextCommandReply setAccount(final String account) {
130 this.account = account;
131 return null;
132 }
133
134 @Override
135 public final CommandExecutorInterface getCommandExecutor() {
136
137 return null;
138 }
139
140 }