Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4404
Block.java
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
Block.java
View Options
/*
* Copyright (C) 2013-2015 Lannocc Technologies
* @%@~LICENSE~@%@
*/
package
com.iovar.web.bin.shell.task
;
// local imports:
import
com.iovar.web.dev.*
;
import
com.iovar.web.proc.*
;
// java imports:
import
java.io.*
;
import
javax.servlet.*
;
// 3rd-party imports:
/**
* A formalized group (i.e. list of operations surrounded by curly braces, invoked sequentially in a sub-shell).
*
* @author shawn@lannocc.com
*/
class
Block
implements
Graph
,
Task
{
Group
ops
;
public
boolean
assemble
(
final
GraphReader
in
)
throws
GraphException
,
IOException
{
if
(
'{'
!=
in
.
peek
())
return
false
;
// FIXME: we really need a double-peek so we can require whitespace or newline after opening brace
in
.
discard
();
Log
.
debug
(
"will assemble"
);
ops
=
new
Group
();
if
(!
ops
.
assemble
(
in
))
ops
=
null
;
if
(
'}'
!=
in
.
peek
())
throw
new
GraphException
(
"Missing closing curly brace"
);
in
.
discard
();
return
true
;
}
public
Return
exec
(
final
TaskData
task
)
throws
IOException
,
ServletException
{
return
ops
.
exec
(
task
);
}
public
String
toString
()
{
final
StringBuffer
s
=
new
StringBuffer
();
s
.
append
(
"{ "
);
if
(
ops
!=
null
)
s
.
append
(
ops
.
toString
());
s
.
append
(
" }"
);
return
s
.
toString
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Mon, Sep 14, 4:12 PM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3636
Default Alt Text
Block.java (1 KB)
Attached To
Mode
rIOVAR Web Platform
Attached
Detach File
Event Timeline
Log In to Comment