Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
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
DEMO
spring-boot
Commits
6d23ce2a
Commit
6d23ce2a
authored
Apr 11, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
7709352c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
ResourceUtils.java
...java/org/springframework/boot/cli/util/ResourceUtils.java
+0
-6
ClassPathFileSystemWatcherTests.java
...t/devtools/classpath/ClassPathFileSystemWatcherTests.java
+8
-2
No files found.
spring-boot-cli/src/main/java/org/springframework/boot/cli/util/ResourceUtils.java
View file @
6d23ce2a
...
...
@@ -66,20 +66,16 @@ public abstract class ResourceUtils {
* @return a list of URLs
*/
public
static
List
<
String
>
getUrls
(
String
path
,
ClassLoader
classLoader
)
{
if
(
classLoader
==
null
)
{
classLoader
=
ClassUtils
.
getDefaultClassLoader
();
}
path
=
StringUtils
.
cleanPath
(
path
);
try
{
return
getUrlsFromWildcardPath
(
path
,
classLoader
);
}
catch
(
Exception
ex
)
{
throw
new
IllegalArgumentException
(
"Cannot create URL from path ["
+
path
+
"]"
,
ex
);
}
}
...
...
@@ -88,7 +84,6 @@ public abstract class ResourceUtils {
if
(
path
.
contains
(
":"
))
{
return
getUrlsFromPrefixedWildcardPath
(
path
,
classLoader
);
}
Set
<
String
>
result
=
new
LinkedHashSet
<
String
>();
try
{
result
.
addAll
(
getUrls
(
FILE_URL_PREFIX
+
path
,
classLoader
));
...
...
@@ -96,7 +91,6 @@ public abstract class ResourceUtils {
catch
(
IllegalArgumentException
ex
)
{
// ignore
}
path
=
stripLeadingSlashes
(
path
);
result
.
addAll
(
getUrls
(
ALL_CLASSPATH_URL_PREFIX
+
path
,
classLoader
));
return
new
ArrayList
<
String
>(
result
);
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcherTests.java
View file @
6d23ce2a
...
...
@@ -77,11 +77,17 @@ public class ClassPathFileSystemWatcherTests {
context
.
getEnvironment
().
getPropertySources
().
addLast
(
propertySource
);
context
.
register
(
Config
.
class
);
context
.
refresh
();
Thread
.
sleep
(
1
00
);
Thread
.
sleep
(
2
00
);
File
classFile
=
new
File
(
folder
,
"Example.class"
);
FileCopyUtils
.
copy
(
"file"
.
getBytes
(),
classFile
);
Thread
.
sleep
(
1
1
00
);
Thread
.
sleep
(
1
0
00
);
List
<
ClassPathChangedEvent
>
events
=
context
.
getBean
(
Listener
.
class
).
getEvents
();
for
(
int
i
=
0
;
i
<
20
;
i
++)
{
if
(!
events
.
isEmpty
())
{
break
;
}
Thread
.
sleep
(
500
);
}
assertThat
(
events
.
size
()).
isEqualTo
(
1
);
assertThat
(
events
.
get
(
0
).
getChangeSet
().
iterator
().
next
().
getFiles
().
iterator
()
.
next
().
getFile
()).
isEqualTo
(
classFile
);
...
...
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