Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
webmagic
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
沈俊林
webmagic
Commits
7e17c71c
Commit
7e17c71c
authored
Jun 23, 2013
by
yihua.huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add page skip
parent
9b1ba6e8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
Page.java
webmagic-core/src/main/java/us/codecraft/webmagic/Page.java
+10
-0
FreemarkerPipeline.java
...va/us/codecraft/webmagic/pipeline/FreemarkerPipeline.java
+5
-2
No files found.
webmagic-core/src/main/java/us/codecraft/webmagic/Page.java
View file @
7e17c71c
...
...
@@ -35,6 +35,16 @@ public class Page {
private
List
<
Request
>
targetRequests
=
new
ArrayList
<
Request
>();
private
boolean
skip
;
public
boolean
isSkip
()
{
return
skip
;
}
public
void
setSkip
(
boolean
skip
)
{
this
.
skip
=
skip
;
}
public
Page
()
{
}
...
...
webmagic-plugin/src/main/java/us/codecraft/webmagic/pipeline/FreemarkerPipeline.java
View file @
7e17c71c
...
...
@@ -40,6 +40,9 @@ public class FreemarkerPipeline implements Pipeline {
@Override
public
void
process
(
Page
page
,
Task
task
)
{
if
(
page
.
isSkip
())
{
return
;
}
String
path
=
this
.
path
+
""
+
task
.
getUUID
()
+
"/"
;
File
file
=
new
File
(
path
);
if
(!
file
.
exists
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment