Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
unimelb-mf-clients
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
resplat-mediaflux
unimelb-mf-clients
Commits
605a0a4c
Commit
605a0a4c
authored
2 years ago
by
Wei Liu
Browse files
Options
Downloads
Patches
Plain Diff
add option to sort the result newest to oldest
parent
4bc98a51
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/unimelb/mf/client/instrument/cli/InstrumentUploadList.java
+16
-5
16 additions, 5 deletions
...nimelb/mf/client/instrument/cli/InstrumentUploadList.java
with
16 additions
and
5 deletions
src/main/java/unimelb/mf/client/instrument/cli/InstrumentUploadList.java
+
16
−
5
View file @
605a0a4c
...
...
@@ -60,6 +60,9 @@ public class InstrumentUploadList implements MFCommand {
@Option
(
names
=
{
"-c"
,
"--compare"
},
description
=
"Compare with local source file/directory."
)
private
boolean
compare
;
@Option
(
names
=
{
"-n"
,
"--newest-to-oldest"
},
description
=
"Sort newest to oldest."
)
private
boolean
newestToOldest
;
@Option
(
names
=
{
"-o"
,
"--output-csv"
},
paramLabel
=
"<output.csv>"
,
description
=
"Path to the output .csv file."
)
private
Path
outputCSVFile
;
...
...
@@ -114,16 +117,15 @@ public class InstrumentUploadList implements MFCommand {
settings
.
setSrcPath
(
sp
);
}
}
if
(
this
.
compare
)
{
settings
.
setCompare
(
compare
);
}
settings
.
setCompare
(
this
.
compare
);
settings
.
setNewestToOldest
(
this
.
newestToOldest
);
if
(
this
.
outputCSVFile
!=
null
)
{
settings
.
setOutputCSVFile
(
this
.
outputCSVFile
);
}
Set
<
Upload
>
uploads
=
UploadShareable
.
findUploads
(
session
,
settings
.
shareableId
(),
settings
.
shareableToken
(),
settings
.
after
(),
settings
.
before
(),
settings
.
shareWith
(),
settings
.
keywords
(),
settings
.
srcPath
(),
true
);
settings
.
newestToOldest
()
);
if
(!
uploads
.
isEmpty
())
{
if
(
settings
.
compare
())
{
for
(
Upload
upload
:
uploads
)
{
...
...
@@ -132,7 +134,6 @@ public class InstrumentUploadList implements MFCommand {
}
System
.
out
.
println
();
UploadShareable
.
printUploads
(
uploads
,
System
.
out
);
if
(
settings
.
outputCSVFile
()
!=
null
)
{
UploadShareable
.
saveToCSVFile
(
session
,
uploads
,
settings
.
outputCSVFile
(),
settings
.
compare
());
...
...
@@ -150,6 +151,7 @@ public class InstrumentUploadList implements MFCommand {
private
Date
_after
;
private
Path
_srcPath
;
private
boolean
_compare
=
false
;
private
boolean
_newestToOldest
=
false
;
private
Path
_outputCSVFile
;
Long
shareableId
()
{
...
...
@@ -184,6 +186,10 @@ public class InstrumentUploadList implements MFCommand {
return
_compare
;
}
boolean
newestToOldest
()
{
return
_newestToOldest
;
}
Path
outputCSVFile
()
{
return
_outputCSVFile
;
}
...
...
@@ -238,6 +244,11 @@ public class InstrumentUploadList implements MFCommand {
return
this
;
}
public
Settings
setNewestToOldest
(
boolean
newestToOldest
)
{
_newestToOldest
=
newestToOldest
;
return
this
;
}
public
Settings
setOutputCSVFile
(
Path
outputCSVFile
)
throws
InterruptedException
{
String
name
=
outputCSVFile
.
getFileName
().
toString
();
if
(!
name
.
toLowerCase
().
endsWith
(
".csv"
))
{
...
...
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