Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CDMABox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Software Control System
Libraries
java
CDMABox
Commits
0770225c
Commit
0770225c
authored
May 11, 2020
by
Raphael GIRARDOT
Browse files
Options
Downloads
Patches
Plain Diff
FileListManager uses a Logger instead of println
parent
19acc5c1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/fr/soleil/cdma/box/manager/FileListManager.java
+13
-8
13 additions, 8 deletions
...main/java/fr/soleil/cdma/box/manager/FileListManager.java
src/main/java/fr/soleil/cdma/box/view/FileView.java
+2
-1
2 additions, 1 deletion
src/main/java/fr/soleil/cdma/box/view/FileView.java
with
15 additions
and
9 deletions
src/main/java/fr/soleil/cdma/box/manager/FileListManager.java
+
13
−
8
View file @
0770225c
...
...
@@ -6,6 +6,7 @@ import java.util.ArrayList;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.TreeMap
;
...
...
@@ -13,6 +14,8 @@ import javax.swing.JOptionPane;
import
javax.swing.SwingWorker
;
import
javax.swing.filechooser.FileSystemView
;
import
org.slf4j.Logger
;
import
fr.soleil.cdma.box.util.GUIUtilities
;
import
fr.soleil.cdma.box.util.comparator.LongComparator
;
import
fr.soleil.data.mediator.Mediator
;
...
...
@@ -31,16 +34,18 @@ import fr.soleil.lib.project.resource.MessageManager;
*/
public
class
FileListManager
implements
IFileManager
{
private
File
[]
availableFiles
;
private
final
BasicDataSource
<
File
[]>
fileListSource
;
private
FileRefresher
refresher
;
private
MessageManager
messageManager
;
private
final
Logger
logger
;
private
File
[]
availableFiles
;
private
FileRefresher
refresher
;
private
String
workingPath
;
private
boolean
waitForStability
;
private
String
[]
filteredExtensions
;
public
FileListManager
(
MessageManager
messageManager
,
String
...
filteredExtensions
)
{
public
FileListManager
(
MessageManager
messageManager
,
Logger
logger
,
String
...
filteredExtensions
)
{
this
.
messageManager
=
messageManager
;
this
.
logger
=
logger
;
this
.
filteredExtensions
=
filteredExtensions
;
availableFiles
=
null
;
workingPath
=
null
;
...
...
@@ -210,9 +215,9 @@ public class FileListManager implements IFileManager {
public
static
final
String
SLEEPING_TIME_PROPERTY
=
"SLEEPING_TIME"
;
public
static
final
String
VERBOSE_PROPERTY
=
"VERBOSE_REFRESHER"
;
protected
final
Hash
Map
<
String
,
File
>
knownFiles
;
protected
final
Hash
Map
<
String
,
Long
>
lastKnownLength
;
protected
final
Hash
Map
<
String
,
Long
>
lastKnownModificationDate
;
protected
final
Map
<
String
,
File
>
knownFiles
;
protected
final
Map
<
String
,
Long
>
lastKnownLength
;
protected
final
Map
<
String
,
Long
>
lastKnownModificationDate
;
private
String
path
;
private
volatile
boolean
canceled
;
...
...
@@ -292,7 +297,7 @@ public class FileListManager implements IFileManager {
infoBuffer
.
append
(
messageManager
.
getMessage
(
"fr.soleil.cdma.box.manager.FileListManager.Refresh.seconds"
));
}
System
.
out
.
println
(
infoBuffer
.
toString
());
logger
.
trace
(
infoBuffer
.
toString
());
infoBuffer
=
null
;
}
// end if (verbose)
if
(!
isCanceled
())
{
...
...
@@ -315,7 +320,7 @@ public class FileListManager implements IFileManager {
messageBuffer
.
append
(
t
.
getMessage
());
JOptionPane
.
showMessageDialog
(
parentComponent
,
messageBuffer
.
toString
(),
messageManager
.
getMessage
(
"fr.soleil.cdma.box.Error"
),
JOptionPane
.
ERROR_MESSAGE
);
System
.
err
.
println
(
messageBuffer
.
toString
());
logger
.
error
(
messageBuffer
.
toString
());
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/fr/soleil/cdma/box/view/FileView.java
+
2
−
1
View file @
0770225c
...
...
@@ -129,7 +129,8 @@ public class FileView extends JPanel implements IBooleanTarget {
}
}
});
fileManager
=
new
FileListManager
(
messageManager
,
filteredExtensions
);
fileManager
=
new
FileListManager
(
messageManager
,
LoggerFactory
.
getLogger
(
this
.
applicationId
),
filteredExtensions
);
fileManager
.
setWaitForStability
(
false
);
fileTreeModelListener
=
new
TreeModelListener
()
{
@Override
...
...
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