File tree Expand file tree Collapse file tree 4 files changed +17
-24
lines changed
main/java/com/google/edwmigration/dumper/application/dumper/connector
test/java/com/google/edwmigration/dumper/application/dumper Expand file tree Collapse file tree 4 files changed +17
-24
lines changed Original file line number Diff line number Diff line change 1919import com .google .edwmigration .dumper .application .dumper .ConnectorArguments ;
2020import com .google .edwmigration .dumper .application .dumper .handle .Handle ;
2121import com .google .edwmigration .dumper .application .dumper .task .Task ;
22- import java .text .Format ;
23- import java .text .SimpleDateFormat ;
2422import java .util .List ;
2523import javax .annotation .Nonnull ;
26- import org .apache .commons .lang3 .StringUtils ;
2724
2825/**
2926 *
@@ -39,16 +36,7 @@ public enum DefaultProperties implements ConnectorProperty {
3936 public String getName ();
4037
4138 @ Nonnull
42- default String getDefaultFileName (boolean isAssessment ) {
43- Format format = new SimpleDateFormat ("yyyyMMdd'T'HHmmss" );
44- String timeSuffix = "-" + format .format (System .currentTimeMillis ());
45- return String .format ("dwh-migration-%s-%s%s.zip" ,
46- getName (), getType (), isAssessment ? timeSuffix : StringUtils .EMPTY
47- );
48- }
49-
50- @ Nonnull
51- String getType ();
39+ public String getDefaultFileName (boolean isAssessment );
5240
5341 @ Nonnull
5442 public void addTasksTo (@ Nonnull List <? super Task <?>> out ,
Original file line number Diff line number Diff line change 1616 */
1717package com .google .edwmigration .dumper .application .dumper .connector ;
1818
19+ import java .text .Format ;
20+ import java .text .SimpleDateFormat ;
21+ import javax .annotation .Nonnull ;
22+ import org .apache .commons .lang3 .StringUtils ;
23+
1924/**
2025 *
2126 * @author shevek
2227 */
2328public interface LogsConnector extends Connector {
24- @ Override
25- default String getType () {
26- return "logs" ;
29+
30+ @ Nonnull
31+ default String getDefaultFileName (boolean isAssessment ) {
32+ Format format = new SimpleDateFormat ("yyyyMMdd'T'HHmmss" );
33+ String timeSuffix = "-" + format .format (System .currentTimeMillis ());
34+ return String .format ("dwh-migration-%s-logs%s.zip" ,
35+ getName (), isAssessment ? timeSuffix : StringUtils .EMPTY );
2736 }
37+
2838}
Original file line number Diff line number Diff line change 2121 * @author shevek
2222 */
2323public interface MetadataConnector extends Connector {
24+
2425 @ Override
25- default String getType ( ) {
26- return "metadata" ;
26+ default String getDefaultFileName ( boolean isAssessment ) {
27+ return "dwh-migration-" + getName () + "- metadata.zip " ;
2728 }
2829}
Original file line number Diff line number Diff line change @@ -132,12 +132,6 @@ public String getDefaultFileName(boolean ignored) {
132132 return StringUtils .EMPTY ;
133133 }
134134
135- @ Nonnull
136- @ Override
137- public String getType () {
138- return StringUtils .EMPTY ;
139- }
140-
141135 @ Override
142136 public void addTasksTo (@ Nonnull List <? super Task <?>> out ,
143137 @ Nonnull ConnectorArguments arguments ) {
You can’t perform that action at this time.
0 commit comments