13
13
import io .flutter .plugin .common .BinaryMessenger ;
14
14
import io .flutter .plugin .common .MessageCodec ;
15
15
import io .flutter .plugin .common .StandardMessageCodec ;
16
- import java .io .ByteArrayOutputStream ;
17
- import java .nio .ByteBuffer ;
18
16
import java .util .ArrayList ;
19
- import java .util .Arrays ;
20
- import java .util .Collections ;
21
- import java .util .HashMap ;
22
17
import java .util .List ;
23
- import java .util .Map ;
24
18
25
19
/** Generated class from Pigeon. */
26
20
@ SuppressWarnings ({"unused" , "unchecked" , "CodeBlock2Expr" , "RedundantSuppression" , "serial" })
@@ -35,8 +29,7 @@ public static class FlutterError extends RuntimeException {
35
29
/** The error details. Must be a datatype supported by the api codec. */
36
30
public final Object details ;
37
31
38
- public FlutterError (@ NonNull String code , @ Nullable String message , @ Nullable Object details )
39
- {
32
+ public FlutterError (@ NonNull String code , @ Nullable String message , @ Nullable Object details ) {
40
33
super (message );
41
34
this .code = code ;
42
35
this .details = details ;
@@ -55,7 +48,7 @@ protected static ArrayList<Object> wrapError(@NonNull Throwable exception) {
55
48
errorList .add (exception .toString ());
56
49
errorList .add (exception .getClass ().getSimpleName ());
57
50
errorList .add (
58
- "Cause: " + exception .getCause () + ", Stacktrace: " + Log .getStackTraceString (exception ));
51
+ "Cause: " + exception .getCause () + ", Stacktrace: " + Log .getStackTraceString (exception ));
59
52
}
60
53
return errorList ;
61
54
}
@@ -82,47 +75,51 @@ private StorageDirectory(final int index) {
82
75
/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
83
76
public interface PathProviderApi {
84
77
85
- @ Nullable
78
+ @ Nullable
86
79
String getTemporaryPath ();
87
80
88
- @ Nullable
81
+ @ Nullable
89
82
String getApplicationSupportPath ();
90
83
91
- @ Nullable
84
+ @ Nullable
92
85
String getApplicationDocumentsPath ();
93
86
94
- @ Nullable
87
+ @ Nullable
95
88
String getExternalStoragePath ();
96
89
97
- @ NonNull
90
+ @ NonNull
98
91
List <String > getExternalCachePaths ();
99
92
100
- @ NonNull
93
+ @ NonNull
101
94
List <String > getExternalStoragePaths (@ NonNull StorageDirectory directory );
102
95
103
- @ Nullable
96
+ @ Nullable
104
97
String getDownloadsPath ();
105
98
106
99
/** The codec used by PathProviderApi. */
107
100
static @ NonNull MessageCodec <Object > getCodec () {
108
101
return new StandardMessageCodec ();
109
102
}
110
- /**Sets up an instance of `PathProviderApi` to handle messages through the `binaryMessenger`. */
103
+ /**
104
+ * Sets up an instance of `PathProviderApi` to handle messages through the `binaryMessenger`.
105
+ */
111
106
static void setup (@ NonNull BinaryMessenger binaryMessenger , @ Nullable PathProviderApi api ) {
112
107
{
113
108
BinaryMessenger .TaskQueue taskQueue = binaryMessenger .makeBackgroundTaskQueue ();
114
109
BasicMessageChannel <Object > channel =
115
110
new BasicMessageChannel <>(
116
- binaryMessenger , "dev.flutter.pigeon.PathProviderApi.getTemporaryPath" , getCodec (), taskQueue );
111
+ binaryMessenger ,
112
+ "dev.flutter.pigeon.PathProviderApi.getTemporaryPath" ,
113
+ getCodec (),
114
+ taskQueue );
117
115
if (api != null ) {
118
116
channel .setMessageHandler (
119
117
(message , reply ) -> {
120
118
ArrayList <Object > wrapped = new ArrayList <Object >();
121
119
try {
122
120
String output = api .getTemporaryPath ();
123
121
wrapped .add (0 , output );
124
- }
125
- catch (Throwable exception ) {
122
+ } catch (Throwable exception ) {
126
123
ArrayList <Object > wrappedError = wrapError (exception );
127
124
wrapped = wrappedError ;
128
125
}
@@ -136,16 +133,18 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid
136
133
BinaryMessenger .TaskQueue taskQueue = binaryMessenger .makeBackgroundTaskQueue ();
137
134
BasicMessageChannel <Object > channel =
138
135
new BasicMessageChannel <>(
139
- binaryMessenger , "dev.flutter.pigeon.PathProviderApi.getApplicationSupportPath" , getCodec (), taskQueue );
136
+ binaryMessenger ,
137
+ "dev.flutter.pigeon.PathProviderApi.getApplicationSupportPath" ,
138
+ getCodec (),
139
+ taskQueue );
140
140
if (api != null ) {
141
141
channel .setMessageHandler (
142
142
(message , reply ) -> {
143
143
ArrayList <Object > wrapped = new ArrayList <Object >();
144
144
try {
145
145
String output = api .getApplicationSupportPath ();
146
146
wrapped .add (0 , output );
147
- }
148
- catch (Throwable exception ) {
147
+ } catch (Throwable exception ) {
149
148
ArrayList <Object > wrappedError = wrapError (exception );
150
149
wrapped = wrappedError ;
151
150
}
@@ -159,16 +158,18 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid
159
158
BinaryMessenger .TaskQueue taskQueue = binaryMessenger .makeBackgroundTaskQueue ();
160
159
BasicMessageChannel <Object > channel =
161
160
new BasicMessageChannel <>(
162
- binaryMessenger , "dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath" , getCodec (), taskQueue );
161
+ binaryMessenger ,
162
+ "dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath" ,
163
+ getCodec (),
164
+ taskQueue );
163
165
if (api != null ) {
164
166
channel .setMessageHandler (
165
167
(message , reply ) -> {
166
168
ArrayList <Object > wrapped = new ArrayList <Object >();
167
169
try {
168
170
String output = api .getApplicationDocumentsPath ();
169
171
wrapped .add (0 , output );
170
- }
171
- catch (Throwable exception ) {
172
+ } catch (Throwable exception ) {
172
173
ArrayList <Object > wrappedError = wrapError (exception );
173
174
wrapped = wrappedError ;
174
175
}
@@ -182,16 +183,18 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid
182
183
BinaryMessenger .TaskQueue taskQueue = binaryMessenger .makeBackgroundTaskQueue ();
183
184
BasicMessageChannel <Object > channel =
184
185
new BasicMessageChannel <>(
185
- binaryMessenger , "dev.flutter.pigeon.PathProviderApi.getExternalStoragePath" , getCodec (), taskQueue );
186
+ binaryMessenger ,
187
+ "dev.flutter.pigeon.PathProviderApi.getExternalStoragePath" ,
188
+ getCodec (),
189
+ taskQueue );
186
190
if (api != null ) {
187
191
channel .setMessageHandler (
188
192
(message , reply ) -> {
189
193
ArrayList <Object > wrapped = new ArrayList <Object >();
190
194
try {
191
195
String output = api .getExternalStoragePath ();
192
196
wrapped .add (0 , output );
193
- }
194
- catch (Throwable exception ) {
197
+ } catch (Throwable exception ) {
195
198
ArrayList <Object > wrappedError = wrapError (exception );
196
199
wrapped = wrappedError ;
197
200
}
@@ -205,16 +208,18 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid
205
208
BinaryMessenger .TaskQueue taskQueue = binaryMessenger .makeBackgroundTaskQueue ();
206
209
BasicMessageChannel <Object > channel =
207
210
new BasicMessageChannel <>(
208
- binaryMessenger , "dev.flutter.pigeon.PathProviderApi.getExternalCachePaths" , getCodec (), taskQueue );
211
+ binaryMessenger ,
212
+ "dev.flutter.pigeon.PathProviderApi.getExternalCachePaths" ,
213
+ getCodec (),
214
+ taskQueue );
209
215
if (api != null ) {
210
216
channel .setMessageHandler (
211
217
(message , reply ) -> {
212
218
ArrayList <Object > wrapped = new ArrayList <Object >();
213
219
try {
214
220
List <String > output = api .getExternalCachePaths ();
215
221
wrapped .add (0 , output );
216
- }
217
- catch (Throwable exception ) {
222
+ } catch (Throwable exception ) {
218
223
ArrayList <Object > wrappedError = wrapError (exception );
219
224
wrapped = wrappedError ;
220
225
}
@@ -228,18 +233,21 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid
228
233
BinaryMessenger .TaskQueue taskQueue = binaryMessenger .makeBackgroundTaskQueue ();
229
234
BasicMessageChannel <Object > channel =
230
235
new BasicMessageChannel <>(
231
- binaryMessenger , "dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths" , getCodec (), taskQueue );
236
+ binaryMessenger ,
237
+ "dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths" ,
238
+ getCodec (),
239
+ taskQueue );
232
240
if (api != null ) {
233
241
channel .setMessageHandler (
234
242
(message , reply ) -> {
235
243
ArrayList <Object > wrapped = new ArrayList <Object >();
236
244
ArrayList <Object > args = (ArrayList <Object >) message ;
237
- StorageDirectory directoryArg = args .get (0 ) == null ? null : StorageDirectory .values ()[(int ) args .get (0 )];
245
+ StorageDirectory directoryArg =
246
+ args .get (0 ) == null ? null : StorageDirectory .values ()[(int ) args .get (0 )];
238
247
try {
239
248
List <String > output = api .getExternalStoragePaths (directoryArg );
240
249
wrapped .add (0 , output );
241
- }
242
- catch (Throwable exception ) {
250
+ } catch (Throwable exception ) {
243
251
ArrayList <Object > wrappedError = wrapError (exception );
244
252
wrapped = wrappedError ;
245
253
}
@@ -253,16 +261,18 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid
253
261
BinaryMessenger .TaskQueue taskQueue = binaryMessenger .makeBackgroundTaskQueue ();
254
262
BasicMessageChannel <Object > channel =
255
263
new BasicMessageChannel <>(
256
- binaryMessenger , "dev.flutter.pigeon.PathProviderApi.getDownloadsPath" , getCodec (), taskQueue );
264
+ binaryMessenger ,
265
+ "dev.flutter.pigeon.PathProviderApi.getDownloadsPath" ,
266
+ getCodec (),
267
+ taskQueue );
257
268
if (api != null ) {
258
269
channel .setMessageHandler (
259
270
(message , reply ) -> {
260
271
ArrayList <Object > wrapped = new ArrayList <Object >();
261
272
try {
262
273
String output = api .getDownloadsPath ();
263
274
wrapped .add (0 , output );
264
- }
265
- catch (Throwable exception ) {
275
+ } catch (Throwable exception ) {
266
276
ArrayList <Object > wrappedError = wrapError (exception );
267
277
wrapped = wrappedError ;
268
278
}
0 commit comments