Subversion Repositories XServices

Rev

Rev 198 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 198 Rev 199
Line 15... Line 15...
15
*/
15
*/
Line 16... Line 16...
16
 
16
 
Line 17... Line -...
17
 
-
 
-
 
17
 
18
package net.brutex.xservices.security;
18
package net.brutex.xservices.security;
19
 
19
 
20
import org.apache.logging.log4j.LogManager;
20
 
21
import org.apache.logging.log4j.Logger;
21
import lombok.extern.slf4j.Slf4j;
Line 22... Line 22...
22
import org.apache.shiro.config.Ini;
22
import org.apache.shiro.config.Ini;
Line 36... Line 36...
36
 *
36
 *
37
 */
37
 */
38
/**
38
/**
39
 * The Class XServicesRealm.
39
 * The Class XServicesRealm.
40
 */
40
 */
-
 
41
@Slf4j
41
public class XServicesRealm extends IniRealm implements Nameable  {
42
public class XServicesRealm extends IniRealm implements Nameable  {
Line 42... Line -...
42
 
-
 
43
	/** The logger. */
-
 
Line 44... Line 43...
44
	private final Logger logger = LogManager.getLogger();
43
 
45
	
44
	
Line 46... Line 45...
46
	/** The name. */
45
	/** The name. */
Line 69... Line 68...
69
			classesRootDir = getClass().getProtectionDomain().getCodeSource().getLocation().toURI();
68
			classesRootDir = getClass().getProtectionDomain().getCodeSource().getLocation().toURI();
70
			String dir = classesRootDir.toString().replaceAll("%20", " ");
69
			String dir = classesRootDir.toString().replaceAll("%20", " ");
71
			dir = dir.substring(0,  dir.lastIndexOf("WEB-INF"));
70
			dir = dir.substring(0,  dir.lastIndexOf("WEB-INF"));
72
		this.setIni(Ini.fromResourcePath(dir+"/WEB-INF/shiro.ini"));
71
		this.setIni(Ini.fromResourcePath(dir+"/WEB-INF/shiro.ini"));
73
		} catch (URISyntaxException e) {
72
		} catch (URISyntaxException e) {
74
			logger.error(e.getMessage(), e);
73
			log.error(e.getMessage(), e);
75
			e.printStackTrace();
74
			e.printStackTrace();
76
		}
75
		}
Line 77... Line 76...
77
		
76