Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Fess Search engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
Fess Search engine
Commits
00ac240f
Commit
00ac240f
authored
Feb 20, 2016
by
Shinsuke Sugaya
Browse files
Options
Downloads
Patches
Plain Diff
fix #374 : rename to CRAWLER_...
parent
737f1f77
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/codelibs/fess/es/config/exentity/DataConfig.java
+27
-27
27 additions, 27 deletions
...java/org/codelibs/fess/es/config/exentity/DataConfig.java
with
27 additions
and
27 deletions
src/main/java/org/codelibs/fess/es/config/exentity/DataConfig.java
+
27
−
27
View file @
00ac240f
...
...
@@ -60,15 +60,15 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
DataConfig
.
class
);
private
static
final
String
S2ROBOT
_WEB_HEADER_PREFIX
=
"crawler.web.header."
;
private
static
final
String
CRAWLER
_WEB_HEADER_PREFIX
=
"crawler.web.header."
;
private
static
final
String
S2ROBOT
_WEB_AUTH
=
"crawler.web.auth"
;
private
static
final
String
CRAWLER
_WEB_AUTH
=
"crawler.web.auth"
;
private
static
final
String
S2ROBOT
_USERAGENT
=
"crawler.useragent"
;
private
static
final
String
CRAWLER
_USERAGENT
=
"crawler.useragent"
;
private
static
final
String
S2ROBOT
_PARAM_PREFIX
=
"crawler.param."
;
private
static
final
String
CRAWLER
_PARAM_PREFIX
=
"crawler.param."
;
private
static
final
Object
S2ROBOT
_FILE_AUTH
=
"crawler.file.auth"
;
private
static
final
Object
CRAWLER
_FILE_AUTH
=
"crawler.file.auth"
;
private
String
[]
labelTypeIds
;
...
...
@@ -240,29 +240,29 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
// parameters
for
(
final
Map
.
Entry
<
String
,
String
>
entry
:
paramMap
.
entrySet
())
{
final
String
key
=
entry
.
getKey
();
if
(
key
.
startsWith
(
S2ROBOT
_PARAM_PREFIX
))
{
factoryParamMap
.
put
(
key
.
substring
(
S2ROBOT
_PARAM_PREFIX
.
length
()),
entry
.
getValue
());
if
(
key
.
startsWith
(
CRAWLER
_PARAM_PREFIX
))
{
factoryParamMap
.
put
(
key
.
substring
(
CRAWLER
_PARAM_PREFIX
.
length
()),
entry
.
getValue
());
}
}
// user agent
final
String
userAgent
=
paramMap
.
get
(
S2ROBOT
_USERAGENT
);
final
String
userAgent
=
paramMap
.
get
(
CRAWLER
_USERAGENT
);
if
(
StringUtil
.
isNotBlank
(
userAgent
))
{
factoryParamMap
.
put
(
HcHttpClient
.
USER_AGENT_PROPERTY
,
userAgent
);
}
// web auth
final
String
webAuthStr
=
paramMap
.
get
(
S2ROBOT
_WEB_AUTH
);
final
String
webAuthStr
=
paramMap
.
get
(
CRAWLER
_WEB_AUTH
);
if
(
StringUtil
.
isNotBlank
(
webAuthStr
))
{
final
String
[]
webAuthNames
=
webAuthStr
.
split
(
","
);
final
List
<
Authentication
>
basicAuthList
=
new
ArrayList
<
Authentication
>();
for
(
final
String
webAuthName
:
webAuthNames
)
{
final
String
scheme
=
paramMap
.
get
(
S2ROBOT
_WEB_AUTH
+
"."
+
webAuthName
+
".scheme"
);
final
String
hostname
=
paramMap
.
get
(
S2ROBOT
_WEB_AUTH
+
"."
+
webAuthName
+
".host"
);
final
String
port
=
paramMap
.
get
(
S2ROBOT
_WEB_AUTH
+
"."
+
webAuthName
+
".port"
);
final
String
realm
=
paramMap
.
get
(
S2ROBOT
_WEB_AUTH
+
"."
+
webAuthName
+
".realm"
);
final
String
username
=
paramMap
.
get
(
S2ROBOT
_WEB_AUTH
+
"."
+
webAuthName
+
".username"
);
final
String
password
=
paramMap
.
get
(
S2ROBOT
_WEB_AUTH
+
"."
+
webAuthName
+
".password"
);
final
String
scheme
=
paramMap
.
get
(
CRAWLER
_WEB_AUTH
+
"."
+
webAuthName
+
".scheme"
);
final
String
hostname
=
paramMap
.
get
(
CRAWLER
_WEB_AUTH
+
"."
+
webAuthName
+
".host"
);
final
String
port
=
paramMap
.
get
(
CRAWLER
_WEB_AUTH
+
"."
+
webAuthName
+
".port"
);
final
String
realm
=
paramMap
.
get
(
CRAWLER
_WEB_AUTH
+
"."
+
webAuthName
+
".realm"
);
final
String
username
=
paramMap
.
get
(
CRAWLER
_WEB_AUTH
+
"."
+
webAuthName
+
".username"
);
final
String
password
=
paramMap
.
get
(
CRAWLER
_WEB_AUTH
+
"."
+
webAuthName
+
".password"
);
if
(
StringUtil
.
isEmpty
(
username
))
{
logger
.
warn
(
"username is empty. webAuth:"
+
webAuthName
);
...
...
@@ -305,8 +305,8 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
Credentials
credentials
;
if
(
Constants
.
NTLM
.
equals
(
scheme
))
{
final
String
workstation
=
paramMap
.
get
(
S2ROBOT
_WEB_AUTH
+
"."
+
webAuthName
+
".workstation"
);
final
String
domain
=
paramMap
.
get
(
S2ROBOT
_WEB_AUTH
+
"."
+
webAuthName
+
".domain"
);
final
String
workstation
=
paramMap
.
get
(
CRAWLER
_WEB_AUTH
+
"."
+
webAuthName
+
".workstation"
);
final
String
domain
=
paramMap
.
get
(
CRAWLER
_WEB_AUTH
+
"."
+
webAuthName
+
".domain"
);
credentials
=
new
NTCredentials
(
username
,
password
==
null
?
StringUtil
.
EMPTY
:
password
,
workstation
==
null
?
StringUtil
.
EMPTY
:
workstation
,
domain
==
null
?
StringUtil
.
EMPTY
:
domain
);
...
...
@@ -324,12 +324,12 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
final
List
<
org
.
codelibs
.
fess
.
crawler
.
client
.
http
.
RequestHeader
>
rhList
=
new
ArrayList
<
org
.
codelibs
.
fess
.
crawler
.
client
.
http
.
RequestHeader
>();
int
count
=
1
;
String
headerName
=
paramMap
.
get
(
S2ROBOT
_WEB_HEADER_PREFIX
+
count
+
".name"
);
String
headerName
=
paramMap
.
get
(
CRAWLER
_WEB_HEADER_PREFIX
+
count
+
".name"
);
while
(
StringUtil
.
isNotBlank
(
headerName
))
{
final
String
headerValue
=
paramMap
.
get
(
S2ROBOT
_WEB_HEADER_PREFIX
+
count
+
".value"
);
final
String
headerValue
=
paramMap
.
get
(
CRAWLER
_WEB_HEADER_PREFIX
+
count
+
".value"
);
rhList
.
add
(
new
org
.
codelibs
.
fess
.
crawler
.
client
.
http
.
RequestHeader
(
headerName
,
headerValue
));
count
++;
headerName
=
paramMap
.
get
(
S2ROBOT
_WEB_HEADER_PREFIX
+
count
+
".name"
);
headerName
=
paramMap
.
get
(
CRAWLER
_WEB_HEADER_PREFIX
+
count
+
".name"
);
}
if
(!
rhList
.
isEmpty
())
{
factoryParamMap
.
put
(
HcHttpClient
.
REQUERT_HEADERS_PROPERTY
,
...
...
@@ -337,18 +337,18 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
}
// file auth
final
String
fileAuthStr
=
paramMap
.
get
(
S2ROBOT
_FILE_AUTH
);
final
String
fileAuthStr
=
paramMap
.
get
(
CRAWLER
_FILE_AUTH
);
if
(
StringUtil
.
isNotBlank
(
fileAuthStr
))
{
final
String
[]
fileAuthNames
=
fileAuthStr
.
split
(
","
);
final
List
<
SmbAuthentication
>
smbAuthList
=
new
ArrayList
<
SmbAuthentication
>();
for
(
final
String
fileAuthName
:
fileAuthNames
)
{
final
String
scheme
=
paramMap
.
get
(
S2ROBOT
_FILE_AUTH
+
"."
+
fileAuthName
+
".scheme"
);
final
String
scheme
=
paramMap
.
get
(
CRAWLER
_FILE_AUTH
+
"."
+
fileAuthName
+
".scheme"
);
if
(
Constants
.
SAMBA
.
equals
(
scheme
))
{
final
String
domain
=
paramMap
.
get
(
S2ROBOT
_FILE_AUTH
+
"."
+
fileAuthName
+
".domain"
);
final
String
hostname
=
paramMap
.
get
(
S2ROBOT
_FILE_AUTH
+
"."
+
fileAuthName
+
".host"
);
final
String
port
=
paramMap
.
get
(
S2ROBOT
_FILE_AUTH
+
"."
+
fileAuthName
+
".port"
);
final
String
username
=
paramMap
.
get
(
S2ROBOT
_FILE_AUTH
+
"."
+
fileAuthName
+
".username"
);
final
String
password
=
paramMap
.
get
(
S2ROBOT
_FILE_AUTH
+
"."
+
fileAuthName
+
".password"
);
final
String
domain
=
paramMap
.
get
(
CRAWLER
_FILE_AUTH
+
"."
+
fileAuthName
+
".domain"
);
final
String
hostname
=
paramMap
.
get
(
CRAWLER
_FILE_AUTH
+
"."
+
fileAuthName
+
".host"
);
final
String
port
=
paramMap
.
get
(
CRAWLER
_FILE_AUTH
+
"."
+
fileAuthName
+
".port"
);
final
String
username
=
paramMap
.
get
(
CRAWLER
_FILE_AUTH
+
"."
+
fileAuthName
+
".username"
);
final
String
password
=
paramMap
.
get
(
CRAWLER
_FILE_AUTH
+
"."
+
fileAuthName
+
".password"
);
if
(
StringUtil
.
isEmpty
(
username
))
{
logger
.
warn
(
"username is empty. fileAuth:"
+
fileAuthName
);
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment