Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
HIGUCHI Yuta
2015-09-22 16:39:33 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3b3bd1e9647c0752221e76ff864dee85cae06e5b
3b3bd1e9
1 parent
e264bef4
Deprecate Tools.slurp(..)
Change-Id: Id88c7e03a5bfcdfba2fb743ee7816576de25f59d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
core/net/src/main/java/org/onosproject/core/impl/CoreManager.java
utils/misc/src/main/java/org/onlab/util/Tools.java
core/net/src/main/java/org/onosproject/core/impl/CoreManager.java
View file @
3b3bd1e
...
...
@@ -24,7 +24,6 @@ import org.apache.felix.scr.annotations.Reference;
import
org.apache.felix.scr.annotations.ReferenceCardinality
;
import
org.apache.felix.scr.annotations.Service
;
import
org.onlab.util.SharedExecutors
;
import
org.onlab.util.Tools
;
import
org.onosproject.cfg.ComponentConfigService
;
import
org.onosproject.core.ApplicationId
;
import
org.onosproject.core.ApplicationIdStore
;
...
...
@@ -38,6 +37,10 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
java.io.File
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.util.Dictionary
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -87,10 +90,16 @@ public class CoreManager implements CoreService {
public
void
activate
()
{
registerApplication
(
CORE_APP_NAME
);
cfgService
.
registerProperties
(
getClass
());
List
<
String
>
versionLines
=
Tools
.
slurp
(
VERSION_FILE
);
try
{
Path
path
=
Paths
.
get
(
VERSION_FILE
.
getPath
());
List
<
String
>
versionLines
=
Files
.
readAllLines
(
path
);
if
(
versionLines
!=
null
&&
!
versionLines
.
isEmpty
())
{
version
=
Version
.
version
(
versionLines
.
get
(
0
));
}
}
catch
(
IOException
e
)
{
// version file not found, using default
log
.
trace
(
"Version file not found"
,
e
);
}
}
@Deactivate
...
...
utils/misc/src/main/java/org/onlab/util/Tools.java
View file @
3b3bd1e
...
...
@@ -299,7 +299,9 @@ public abstract class Tools {
*
* @param path file path
* @return file contents
* @deprecated in Emu release
*/
@Deprecated
public
static
List
<
String
>
slurp
(
File
path
)
{
try
(
BufferedReader
br
=
new
BufferedReader
(
...
...
Please
register
or
login
to post a comment