├── ADL Store Library for Delphi
├── Sources
│ ├── ADLStoreLibrary4D.dpr
│ ├── ADLStoreLibrary4D.dproj
│ ├── Connector
│ │ ├── ADLSConnector.Interfaces.pas
│ │ └── ADLSConnector.Presenter.pas
│ ├── File Manager
│ │ ├── ADLSFileManager.Interfaces.pas
│ │ └── ADLSFileManager.Presenter.pas
│ ├── UnitTest
│ │ ├── ADLSUnitTest.Classes.pas
│ │ ├── ADLStoreLibrary4DUnitTest.dpr
│ │ └── ADLStoreLibrary4DUnitTest.dproj
│ └── View
│ │ ├── ADLSMain.dfm
│ │ └── ADLSMain.pas
└── img
│ ├── ADLSLibrary4D_Connector.png
│ └── ADLSLibrary4D_FileManager.png
├── LICENSE
└── README.md
/ADL Store Library for Delphi/Sources/ADLStoreLibrary4D.dpr:
--------------------------------------------------------------------------------
1 | program ADLStoreLibrary4D;
2 |
3 | uses
4 | Vcl.Forms,
5 | ADLSConnector.Interfaces in 'Connector\ADLSConnector.Interfaces.pas',
6 | ADLSConnector.Presenter in 'Connector\ADLSConnector.Presenter.pas',
7 | ADLSFileManager.Interfaces in 'File Manager\ADLSFileManager.Interfaces.pas',
8 | ADLSFileManager.Presenter in 'File Manager\ADLSFileManager.Presenter.pas',
9 | ADLSMain in 'View\ADLSMain.pas' {frmADLSMain};
10 |
11 | {$R *.res}
12 |
13 | begin
14 | Application.Initialize;
15 | Application.MainFormOnTaskbar := True;
16 | Application.CreateForm(TfrmADLSMain, frmADLSMain);
17 | Application.Run;
18 | end.
19 |
--------------------------------------------------------------------------------
/ADL Store Library for Delphi/Sources/ADLStoreLibrary4D.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {515B679A-7071-4F1F-AA63-53301B3E9CD3}
4 | 18.1
5 | VCL
6 | ADLStoreLibrary4D.dpr
7 | True
8 | Debug
9 | Win32
10 | 1
11 | Application
12 |
13 |
14 | true
15 |
16 |
17 | true
18 | Base
19 | true
20 |
21 |
22 | true
23 | Base
24 | true
25 |
26 |
27 | true
28 | Base
29 | true
30 |
31 |
32 | true
33 | Cfg_1
34 | true
35 | true
36 |
37 |
38 | true
39 | Base
40 | true
41 |
42 |
43 | true
44 | Cfg_2
45 | true
46 | true
47 |
48 |
49 | .\$(Platform)\$(Config)
50 | .\$(Platform)\$(Config)
51 | $(BDS)\bin\delphi_PROJECTICON.ico
52 | System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)
53 | ADLStoreLibrary4D
54 | .\$(Platform)\$(Config)
55 | .\$(Platform)\$(Config)
56 | false
57 | false
58 | false
59 | false
60 | false
61 |
62 |
63 | $(BDS)\bin\default_app.manifest
64 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
65 | DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;svnui;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;Intraweb;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;DBXSybaseASEDriver;IndyIPServer;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage)
66 | 1033
67 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=
68 | true
69 |
70 |
71 | DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;Intraweb;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;DBXSybaseASEDriver;IndyIPServer;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage)
72 |
73 |
74 | DEBUG;$(DCC_Define)
75 | true
76 | false
77 | true
78 | true
79 | true
80 |
81 |
82 | true
83 | 1033
84 | true
85 | true
86 | false
87 |
88 |
89 | false
90 | RELEASE;$(DCC_Define)
91 | 0
92 | 0
93 |
94 |
95 | true
96 | true
97 |
98 |
99 |
100 | MainSource
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 | dfm
109 |
110 |
111 | Cfg_2
112 | Base
113 |
114 |
115 | Base
116 |
117 |
118 | Cfg_1
119 | Base
120 |
121 |
122 |
123 | Delphi.Personality.12
124 | Application
125 |
126 |
127 |
128 | ADLStoreLibrary4D.dpr
129 |
130 |
131 | Embarcadero C++Builder Office 2000 Servers Package
132 | Embarcadero C++Builder Office XP Servers Package
133 | Microsoft Office 2000 Sample Automation Server Wrapper Components
134 | Microsoft Office XP Sample Automation Server Wrapper Components
135 |
136 |
137 |
138 |
139 |
140 | ADLStoreLibrary4D.exe
141 | true
142 |
143 |
144 |
145 |
146 | 1
147 |
148 |
149 | 1
150 |
151 |
152 |
153 |
154 | Contents\Resources
155 | 1
156 |
157 |
158 |
159 |
160 | classes
161 | 1
162 |
163 |
164 |
165 |
166 | Contents\MacOS
167 | 0
168 |
169 |
170 | 1
171 |
172 |
173 | Contents\MacOS
174 | 1
175 |
176 |
177 |
178 |
179 | 1
180 |
181 |
182 | 1
183 |
184 |
185 | 1
186 |
187 |
188 |
189 |
190 | res\drawable-xxhdpi
191 | 1
192 |
193 |
194 |
195 |
196 | library\lib\mips
197 | 1
198 |
199 |
200 |
201 |
202 | 0
203 |
204 |
205 | 1
206 |
207 |
208 | Contents\MacOS
209 | 1
210 |
211 |
212 | 1
213 |
214 |
215 | library\lib\armeabi-v7a
216 | 1
217 |
218 |
219 | 1
220 |
221 |
222 |
223 |
224 | 0
225 |
226 |
227 | Contents\MacOS
228 | 1
229 | .framework
230 |
231 |
232 |
233 |
234 | 1
235 |
236 |
237 | 1
238 |
239 |
240 | 1
241 |
242 |
243 |
244 |
245 | 1
246 |
247 |
248 | 1
249 |
250 |
251 | 1
252 |
253 |
254 |
255 |
256 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
257 | 1
258 |
259 |
260 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
261 | 1
262 |
263 |
264 |
265 |
266 | library\lib\x86
267 | 1
268 |
269 |
270 |
271 |
272 | 1
273 |
274 |
275 | 1
276 |
277 |
278 | 1
279 |
280 |
281 |
282 |
283 | 1
284 |
285 |
286 | 1
287 |
288 |
289 | 1
290 |
291 |
292 |
293 |
294 | library\lib\armeabi
295 | 1
296 |
297 |
298 |
299 |
300 | 0
301 |
302 |
303 | 1
304 |
305 |
306 | Contents\MacOS
307 | 1
308 |
309 |
310 |
311 |
312 | 1
313 |
314 |
315 | 1
316 |
317 |
318 | 1
319 |
320 |
321 |
322 |
323 | res\drawable-normal
324 | 1
325 |
326 |
327 |
328 |
329 | res\drawable-xhdpi
330 | 1
331 |
332 |
333 |
334 |
335 | res\drawable-large
336 | 1
337 |
338 |
339 |
340 |
341 | 1
342 |
343 |
344 | 1
345 |
346 |
347 | 1
348 |
349 |
350 |
351 |
352 | ../
353 | 1
354 |
355 |
356 | ../
357 | 1
358 |
359 |
360 |
361 |
362 | res\drawable-hdpi
363 | 1
364 |
365 |
366 |
367 |
368 | library\lib\armeabi-v7a
369 | 1
370 |
371 |
372 |
373 |
374 | Contents
375 | 1
376 |
377 |
378 |
379 |
380 | ../
381 | 1
382 |
383 |
384 |
385 |
386 | 1
387 |
388 |
389 | 1
390 |
391 |
392 | 1
393 |
394 |
395 |
396 |
397 | res\values
398 | 1
399 |
400 |
401 |
402 |
403 | res\drawable-small
404 | 1
405 |
406 |
407 |
408 |
409 | res\drawable
410 | 1
411 |
412 |
413 |
414 |
415 | 1
416 |
417 |
418 | 1
419 |
420 |
421 | 1
422 |
423 |
424 |
425 |
426 | 1
427 |
428 |
429 |
430 |
431 | res\drawable
432 | 1
433 |
434 |
435 |
436 |
437 | 0
438 |
439 |
440 | 0
441 |
442 |
443 | Contents\Resources\StartUp\
444 | 0
445 |
446 |
447 | 0
448 |
449 |
450 | 0
451 |
452 |
453 | 0
454 |
455 |
456 |
457 |
458 | library\lib\armeabi-v7a
459 | 1
460 |
461 |
462 |
463 |
464 | 0
465 | .bpl
466 |
467 |
468 | 1
469 | .dylib
470 |
471 |
472 | Contents\MacOS
473 | 1
474 | .dylib
475 |
476 |
477 | 1
478 | .dylib
479 |
480 |
481 | 1
482 | .dylib
483 |
484 |
485 |
486 |
487 | res\drawable-mdpi
488 | 1
489 |
490 |
491 |
492 |
493 | res\drawable-xlarge
494 | 1
495 |
496 |
497 |
498 |
499 | res\drawable-ldpi
500 | 1
501 |
502 |
503 |
504 |
505 | 0
506 | .dll;.bpl
507 |
508 |
509 | 1
510 | .dylib
511 |
512 |
513 | Contents\MacOS
514 | 1
515 | .dylib
516 |
517 |
518 | 1
519 | .dylib
520 |
521 |
522 | 1
523 | .dylib
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 | True
536 | False
537 |
538 | False
539 |
540 | 12
541 |
542 |
543 |
544 |
545 |
546 |
--------------------------------------------------------------------------------
/ADL Store Library for Delphi/Sources/Connector/ADLSConnector.Interfaces.pas:
--------------------------------------------------------------------------------
1 | unit ADLSConnector.Interfaces;
2 |
3 | interface
4 |
5 | type
6 | IADLSConnectorView = interface
7 | ['{9BB081F9-887B-44B5-A352-49BE0261FB0A}']
8 | // Input
9 | function GetBaseURL: string;
10 | function GetClientID: string;
11 | function GetClientSecret: string;
12 | function GetAccessTokenEndpoint: string;
13 | function GetAuthorizationEndpoint: string;
14 | // Output
15 | procedure SetAccessToken(const AValue: string);
16 | procedure SetResponseData(const AValue: string);
17 | procedure AddResponseData(const AValue: string);
18 | end;
19 |
20 | IADLSConnectorPresenter = interface
21 | ['{DA1F18B3-78E3-45B5-B065-A993259B0FBC}']
22 | procedure GetAccessToken;
23 | function GetBaseURL: string;
24 | function GetClientID: string;
25 | function GetToken: string;
26 | property AccessToken: string read GetToken;
27 | end;
28 |
29 | implementation
30 |
31 | end.
32 |
--------------------------------------------------------------------------------
/ADL Store Library for Delphi/Sources/Connector/ADLSConnector.Presenter.pas:
--------------------------------------------------------------------------------
1 | unit ADLSConnector.Presenter;
2 |
3 | interface
4 |
5 | uses
6 | ADLSConnector.Interfaces, REST.Client, REST.Authenticator.OAuth;
7 |
8 | type
9 | TADLSConnectorPresenter = class(TInterfacedObject, IADLSConnectorPresenter)
10 | private
11 | FRESTClient: TRESTClient;
12 | FRESTRequest: TRESTRequest;
13 | FRESTResponse: TRESTResponse;
14 | FOAuth2_AzureDataLake: TOAuth2Authenticator;
15 | ///
16 | /// Reset all of the rest-components for a new request
17 | ///
18 | procedure ResetRESTComponentsToDefaults;
19 | procedure InitComponents;
20 | procedure LocalRESTRequestAfterExecute(Sender: TCustomRESTRequest);
21 | protected
22 | FADLSConnector: IADLSConnectorView;
23 | FAccessToken: string;
24 | function GetToken: string;
25 | public
26 | constructor Create(AADLSConnectorView: IADLSConnectorView);
27 | destructor Destroy; override;
28 | procedure GetAccessToken;
29 | function GetBaseURL: string;
30 | function GetClientID: string;
31 | property AccessToken: string read GetToken;
32 | //property Authenticator: TOAuth2Authenticator read FOAuth2_AzureDataLake;
33 | end;
34 |
35 | implementation
36 |
37 | uses
38 | System.SysUtils, REST.Types, REST.Json;
39 |
40 | { TADLSPresenter }
41 |
42 | constructor TADLSConnectorPresenter.Create(AADLSConnectorView: IADLSConnectorView);
43 | begin
44 | FADLSConnector := AADLSConnectorView;
45 | FRESTClient := TRESTClient.Create(''{FADLSConnector.GetBaseURL});
46 | FRESTRequest := TRESTRequest.Create(nil);
47 | FRESTResponse := TRESTResponse.Create(nil);
48 | FOAuth2_AzureDataLake := TOAuth2Authenticator.Create(nil);
49 |
50 | FRESTRequest.OnAfterExecute := LocalRESTRequestAfterExecute;
51 | end;
52 |
53 | destructor TADLSConnectorPresenter.Destroy;
54 | begin
55 | FOAuth2_AzureDataLake.Free;
56 | FRESTResponse.Free;
57 | FRESTRequest.Free;
58 | FRESTClient.Free;
59 | end;
60 |
61 | procedure TADLSConnectorPresenter.GetAccessToken;
62 | begin
63 | ResetRESTComponentsToDefaults;
64 | InitComponents;
65 |
66 | FRESTClient.BaseURL := FADLSConnector.GetAccessTokenEndpoint;
67 |
68 | FRESTRequest.Method := TRESTRequestMethod.rmPOST;
69 | FRESTRequest.Params.AddItem('client_id', FADLSConnector.GetClientID, TRESTRequestParameterKind.pkGETorPOST);
70 | FRESTRequest.Params.AddItem('client_secret', FADLSConnector.GetClientSecret, TRESTRequestParameterKind.pkGETorPOST);
71 | FRESTRequest.Params.AddItem('grant_type', 'client_credentials', TRESTRequestParameterKind.pkGETorPOST);
72 | FRESTRequest.Params.AddItem('resource', 'https://management.core.windows.net/');
73 |
74 | FRESTRequest.Execute;
75 |
76 | if FRESTRequest.Response.GetSimpleValue('access_token', FAccessToken) then
77 | begin
78 | FOAuth2_AzureDataLake.AccessToken := FAccessToken;
79 | FADLSConnector.SetAccessToken(FAccessToken);
80 | end;
81 | end;
82 |
83 | function TADLSConnectorPresenter.GetBaseURL: string;
84 | begin
85 | Result := FADLSConnector.GetBaseURL;
86 | end;
87 |
88 | function TADLSConnectorPresenter.GetClientID: string;
89 | begin
90 | FADLSConnector.GetClientID;
91 | end;
92 |
93 | function TADLSConnectorPresenter.GetToken: string;
94 | begin
95 | Result := FAccessToken;
96 | end;
97 |
98 | procedure TADLSConnectorPresenter.InitComponents;
99 | begin
100 | FOAuth2_AzureDataLake.AccessTokenEndpoint := FADLSConnector.GetAccessTokenEndpoint;
101 | FOAuth2_AzureDataLake.AuthorizationEndpoint := FADLSConnector.GetAuthorizationEndpoint;
102 | FOAuth2_AzureDataLake.ResponseType := TOAuth2ResponseType(0);
103 | FOAuth2_AzureDataLake.TokenType := TOAuth2TokenType(0);
104 |
105 | FRESTClient.Accept := 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
106 | FRESTClient.Authenticator := FOAuth2_AzureDataLake;
107 |
108 | FRESTRequest.Client := FRESTClient;
109 | FRESTRequest.Response := FRESTResponse;
110 | end;
111 |
112 | procedure TADLSConnectorPresenter.LocalRESTRequestAfterExecute(
113 | Sender: TCustomRESTRequest);
114 | begin
115 | FADLSConnector.SetResponseData('');
116 | //lbl_status.Caption := 'URI: ' + Sender.GetFullRequestURL + ' Execution time: ' +
117 | // IntToStr(Sender.ExecutionPerformance.TotalExecutionTime) + 'ms';
118 | if Assigned(FRESTResponse.JSONValue) then
119 | begin
120 | FADLSConnector.SetResponseData(TJson.Format(FRESTResponse.JSONValue));
121 | end
122 | else
123 | begin
124 | FADLSConnector.AddResponseData(FRESTResponse.Content);
125 | end;
126 | end;
127 |
128 | procedure TADLSConnectorPresenter.ResetRESTComponentsToDefaults;
129 | begin
130 | FRESTClient.ResetToDefaults;
131 | FRESTRequest.ResetToDefaults;
132 | FRESTResponse.ResetToDefaults;
133 | end;
134 |
135 | end.
136 |
--------------------------------------------------------------------------------
/ADL Store Library for Delphi/Sources/File Manager/ADLSFileManager.Interfaces.pas:
--------------------------------------------------------------------------------
1 | unit ADLSFileManager.Interfaces;
2 |
3 | interface
4 |
5 | uses
6 | System.Classes, System.Generics.Collections;
7 |
8 | type
9 |
10 | IADLSFileManagerView = interface
11 | ['{AA452B82-AD29-463F-B93F-D1D51F517AC6}']
12 | // Input
13 | function GetFMBaseURL: string;
14 | function GetFMDirectory: string;
15 | function GetFMFilePath: string;
16 | // Output
17 | procedure DisplayFMMessage(AValue: string);
18 | procedure SetFMDirectory(AValue: TList);
19 | procedure SetFMResponseData(const AValue: string);
20 | procedure AddFMResponseData(const AValue: string);
21 | end;
22 |
23 | IADLSFileManagerPresenter = interface
24 | ['{389E2588-BD83-4F56-A66F-4103F205A787}']
25 | function GetListFolders: TStringList;
26 | procedure UploadFile;
27 | procedure ListFolders;
28 | end;
29 |
30 | implementation
31 |
32 | end.
33 |
--------------------------------------------------------------------------------
/ADL Store Library for Delphi/Sources/File Manager/ADLSFileManager.Presenter.pas:
--------------------------------------------------------------------------------
1 | unit ADLSFileManager.Presenter;
2 |
3 | interface
4 |
5 | uses
6 | System.Classes, System.Generics.Collections, System.JSON.Readers,
7 | System.JSON.Types, REST.Client, ADLSFileManager.Interfaces,
8 | ADLSConnector.Presenter, ADLSConnector.Interfaces;
9 |
10 | type
11 | TADLSResponseReader = class
12 | private const
13 | PATH_SUFFIX = 'pathSuffix';
14 | PATH_TYPE_PROPERTY = 'type';
15 | PATH_TYPE_VALUE = 'Directory';
16 | public
17 | class function ListFoldersExtractor(AJsonTextReader: TJsonTextReader): TList;
18 | end;
19 |
20 |
21 | TADLSFileManagerPresenter = class(TInterfacedObject, IADLSFileManagerPresenter)
22 | private const
23 | RESPONSE_DATA_SEPARATOR = '----------------------------';
24 | WEB_HDFS_RESOURCE_PATH = '/webhdfs/v1/';
25 | OP_LIST_STATUS = 'LISTSTATUS';
26 | OP_CREATE = 'CREATE';
27 | private var
28 | FRESTClient: TRESTClient;
29 | FRESTRequest: TRESTRequest;
30 | FRESTResponse: TRESTResponse;
31 | FADLSConnectorPresenter: IADLSConnectorPresenter;
32 | FOperations: TDictionary;
33 | private
34 | procedure ResetRESTComponentsToDefaults;
35 | procedure InitComponents;
36 | procedure LoadOperations;
37 | protected
38 | FADLSFileManagerView: IADLSFileManagerView;
39 | public
40 | constructor Create(AADLSConnectorPresenter: IADLSConnectorPresenter; AADLSFileManagerView: IADLSFileManagerView);
41 | destructor Destroy; override;
42 | function GetListFolders: TStringList;
43 | procedure UploadFile;
44 | procedure ListFolders;
45 | end;
46 |
47 |
48 | implementation
49 |
50 | uses
51 | System.SysUtils, REST.Utils, REST.Types, REST.Json, REST.HttpClient,
52 | VCL.Dialogs;
53 |
54 | { TADLSFileManagerPresenter }
55 |
56 | constructor TADLSFileManagerPresenter.Create(AADLSConnectorPresenter: IADLSConnectorPresenter;
57 | AADLSFileManagerView: IADLSFileManagerView);
58 | var
59 | LBaseURL: string;
60 | begin
61 | FADLSConnectorPresenter := AADLSConnectorPresenter;
62 | FADLSFileManagerView := AADLSFileManagerView;
63 |
64 | LBaseURL := FADLSConnectorPresenter.GetBaseURL;
65 | FRESTClient := TRESTClient.Create(LBaseURL);
66 | FRESTRequest := TRESTRequest.Create(nil);
67 | FRESTResponse := TRESTResponse.Create(nil);
68 |
69 | LoadOperations;
70 | end;
71 |
72 | destructor TADLSFileManagerPresenter.Destroy;
73 | begin
74 | FRESTResponse.Free;
75 | FRESTRequest.Free;
76 | FRESTClient.Free;
77 | end;
78 |
79 | function TADLSFileManagerPresenter.GetListFolders: TStringList;
80 | begin
81 | // ToDo: work in progress..
82 | Result := TStringList.Create;
83 | end;
84 |
85 | procedure TADLSFileManagerPresenter.InitComponents;
86 | begin
87 | // Authenticator must be set to nil
88 | //FRESTClient.Authenticator := FADLSConnector.Authenticator;
89 | FRESTClient.Authenticator := nil;
90 |
91 | // ToDo:
92 | //FRESTClient.Accept := 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
93 |
94 | FRESTRequest.Client := FRESTClient;
95 | FRESTRequest.Response := FRESTResponse;
96 | end;
97 |
98 | procedure TADLSFileManagerPresenter.ListFolders;
99 | begin
100 | ResetRESTComponentsToDefaults;
101 |
102 | // Initialize connections among the REST components
103 | InitComponents;
104 |
105 | // Get BaseURL from the view
106 | FRESTClient.BaseURL := FADLSFileManagerView.GetFMBaseURL;
107 |
108 | FRESTRequest.Params.Clear;
109 | FRESTRequest.ClearBody;
110 | FRESTRequest.Method := TRestRequestMethod.rmGET;
111 | //FRESTRequest.Resource := '/webhdfs/v1/' + '?op=LISTSTATUS';
112 | FRESTRequest.Resource := WEB_HDFS_RESOURCE_PATH + FOperations.Items[OP_LIST_STATUS];
113 |
114 | // Set Content-Type to text/plain
115 | FRESTRequest.Params.AddHeader('Content-Type', 'text/plain');
116 |
117 | // Add token
118 | FRESTRequest.Params.AddItem('Authorization', 'Bearer ' + FADLSConnectorPresenter.AccessToken,
119 | TRESTRequestParameterKind.pkHTTPHEADER,
120 | [TRESTRequestParameterOption.poDoNotEncode]);
121 |
122 | try
123 | FRESTRequest.Execute;
124 | FADLSFileManagerView.DisplayFMMessage('List folders retrieved successfully');
125 | FADLSFileManagerView.SetFMDirectory(TADLSResponseReader.ListFoldersExtractor(FRESTResponse.JSONReader));
126 | FADLSFileManagerView.AddFMResponseData(RESPONSE_DATA_SEPARATOR);
127 | FADLSFileManagerView.AddFMResponseData(FRESTResponse.Content);
128 | except on E: Exception do
129 | begin
130 | FADLSFileManagerView.DisplayFMMessage('List folders retrieved with errors: ' + E.Message);
131 | FADLSFileManagerView.SetFMDirectory(TList.Create);
132 | end;
133 | end;
134 |
135 | end;
136 |
137 | procedure TADLSFileManagerPresenter.LoadOperations;
138 | begin
139 | if Assigned(FOperations) then
140 | FOperations.Free;
141 |
142 | FOperations := TDictionary.Create;
143 | FOperations.Add(OP_CREATE, '?op=CREATE');
144 | FOperations.Add(OP_LIST_STATUS, '?op=LISTSTATUS');
145 | end;
146 |
147 | procedure TADLSFileManagerPresenter.ResetRESTComponentsToDefaults;
148 | begin
149 | FRESTClient.ResetToDefaults;
150 | FRESTRequest.ResetToDefaults;
151 | FRESTResponse.ResetToDefaults;
152 | end;
153 |
154 | procedure TADLSFileManagerPresenter.UploadFile;
155 | var
156 | LFilePath: string;
157 |
158 | LUploadStream: TFileStream;
159 | LSize: Integer;
160 | LBuffer: TArray;
161 | LEncoding: TEncoding;
162 | LFileContent: string;
163 | begin
164 | ResetRESTComponentsToDefaults;
165 |
166 | // Initialize connections among the REST components
167 | InitComponents;
168 |
169 | // Get file path from the view
170 | LFilePath := FADLSFileManagerView.GetFMFilePath;
171 |
172 | // Get BaseURL from the view
173 | FRESTClient.BaseURL := FADLSFileManagerView.GetFMBaseURL;
174 |
175 | FRESTRequest.Params.Clear;
176 | FRESTRequest.ClearBody;
177 | FRESTRequest.Method := TRestRequestMethod.rmPUT;
178 |
179 | //FRESTRequest.Resource := '/webhdfs/v1/.../' + URIEncode(ExtractFileName(LFilePath))+ '?op=CREATE';
180 | FRESTRequest.Resource := WEB_HDFS_RESOURCE_PATH +
181 | FADLSFileManagerView.GetFMDirectory + '/' +
182 | URIEncode(ExtractFileName(LFilePath)) +
183 | FOperations.Items[OP_CREATE];
184 |
185 | LUploadStream := TFileStream.Create(LFilePath, fmOpenRead);
186 |
187 | try
188 | LUploadStream.Position := 0;
189 |
190 | // Set Content-Type to text/plain
191 | FRESTRequest.Params.AddHeader('Content-Type', 'text/plain');
192 |
193 | // Add token
194 | //FRESTRequest.AddAuthParameter('Authorization', 'Bearer ' + FADLSConnector.AccessToken + '',
195 | // TRESTRequestParameterKind.pkHTTPHEADER,
196 | // [TRESTRequestParameterOption.poDoNotEncode]);
197 | FRESTRequest.Params.AddItem('Authorization', 'Bearer ' + FADLSConnectorPresenter.AccessToken,
198 | TRESTRequestParameterKind.pkHTTPHEADER,
199 | [TRESTRequestParameterOption.poDoNotEncode]);
200 |
201 | LSize := (LUploadStream.Size - LUploadStream.Position);
202 | SetLength(LBuffer, LSize);
203 | LUploadStream.ReadBuffer(Pointer(LBuffer)^, LSize);
204 | LEncoding := nil;
205 | LSize := TEncoding.GetBufferEncoding(LBuffer, LEncoding);
206 | LFileContent := LEncoding.GetString(LBuffer, LSize, Length(LBuffer) - LSize);
207 | FRESTRequest.AddBody(LFileContent, TRESTContentType.ctTEXT_PLAIN);
208 |
209 | try
210 | FRESTRequest.Execute;
211 | FADLSFileManagerView.DisplayFMMessage('Upload completed successfully');
212 | except
213 | on E: EHTTPProtocolException do
214 | begin
215 | FADLSFileManagerView.DisplayFMMessage('Upload completed with an HTTP protocol exception: ' + E.Message);
216 | FADLSFileManagerView.AddFMResponseData('Error: ' + RESPONSE_DATA_SEPARATOR);
217 | FADLSFileManagerView.AddFMResponseData(E.Message);
218 | end;
219 |
220 | on E: Exception do
221 | begin
222 | FADLSFileManagerView.AddFMResponseData('Error: ' + RESPONSE_DATA_SEPARATOR);
223 | FADLSFileManagerView.AddFMResponseData(E.Message);
224 | end;
225 | end;
226 |
227 | finally
228 | LUploadStream.Free;
229 | end;
230 | end;
231 |
232 | { TADLSResponseReader }
233 |
234 | class function TADLSResponseReader.ListFoldersExtractor(AJsonTextReader: TJsonTextReader): TList;
235 | var
236 | LValuePathSuffix: string;
237 | begin
238 | if not Assigned(AJsonTextReader) then
239 | Result := nil
240 | else
241 | begin
242 | Result := TList.Create;
243 |
244 | while AJsonTextReader.Read do
245 | begin
246 | case AJsonTextReader.TokenType of
247 | TJsonToken.PropertyName:
248 | begin
249 | if CompareText(AJsonTextReader.Value.ToString, PATH_SUFFIX) = 0 then
250 | begin
251 | AJsonTextReader.Read;
252 | case AJsonTextReader.TokenType of
253 | TJsonToken.String:
254 | begin
255 | LValuePathSuffix := AJsonTextReader.Value.ToString;
256 | AJsonTextReader.Read;
257 | case AJsonTextReader.TokenType of
258 | TJsonToken.PropertyName:
259 | begin
260 | if CompareText(AJsonTextReader.Value.ToString, PATH_TYPE_PROPERTY) = 0 then
261 | begin
262 | AJsonTextReader.Read;
263 | case AJsonTextReader.TokenType of
264 | TJsonToken.String:
265 | if CompareText(AJsonTextReader.Value.ToString, PATH_TYPE_VALUE) = 0 then
266 | begin
267 | Result.Add(LValuePathSuffix);
268 | LValuePathSuffix := '';
269 | end;
270 | end;
271 | end;
272 | end;
273 | end;
274 | end;
275 | end;
276 | end
277 | end;
278 | end;
279 | end;
280 | end;
281 | end;
282 |
283 | end.
284 |
--------------------------------------------------------------------------------
/ADL Store Library for Delphi/Sources/UnitTest/ADLSUnitTest.Classes.pas:
--------------------------------------------------------------------------------
1 | unit ADLSUnitTest.Classes;
2 |
3 | interface
4 |
5 | uses
6 | DUnitX.TestFramework, ADLSConnector.Interfaces, ADLSFileManager.Interfaces,
7 | ADLSConnector.Presenter, ADLSFileManager.Presenter,
8 | System.Generics.Collections, IPPeerCommon;
9 |
10 | type
11 |
12 | TADLSFakeView = class(TInterfacedObject, IADLSConnectorView, IADLSFileManagerView)
13 | protected
14 | FBaseURL: string;
15 | FClientID: string;
16 | FClientSecret: string;
17 | FAccessTokenEndpoint: string;
18 | FAuthorizationEndpoint: string;
19 | FFMBaseURL: string;
20 | FFMDirectory: string;
21 | FFMFilePath: string;
22 |
23 | FFMDirectories: TList;
24 | FADLSConnectorP: IADLSConnectorPresenter;
25 | FADLSFileManagerP: IADLSFileManagerPresenter;
26 | public
27 | constructor Create(const ABaseURL, AClientID, AClientSecret, AAccessTokenEndpoint,
28 | AAuthorizationEndpoint, AFMBaseURL: string);
29 | //destructor Destroy; override;
30 | // Input connector
31 | function GetBaseURL: string;
32 | function GetClientID: string;
33 | function GetClientSecret: string;
34 | function GetAccessTokenEndpoint: string;
35 | function GetAuthorizationEndpoint: string;
36 | // Input file manager
37 | function GetFMBaseURL: string;
38 | function GetFMDirectory: string;
39 | function GetFMFilePath: string;
40 | // Output connector
41 | procedure SetAccessToken(const AValue: string);
42 | procedure SetResponseData(const AValue: string);
43 | procedure AddResponseData(const AValue: string);
44 | // Output file manager
45 | procedure DisplayFMMessage(AValue: string);
46 | procedure SetFMDirectory(AValue: TList);
47 | procedure SetFMResponseData(const AValue: string);
48 | procedure AddFMResponseData(const AValue: string);
49 |
50 | procedure GetAccessToken;
51 | end;
52 |
53 | [TestFixture]
54 | TADLSUnitTest = class(TObject)
55 | protected
56 | FBaseURL: string;
57 | FClientID: string;
58 | FClientSecret: string;
59 | FAccessTokenEndpoint: string;
60 | FAuthorizationEndpoint: string;
61 | FFMBaseURL: string;
62 | public
63 | [Setup]
64 | procedure Setup;
65 |
66 | [TearDown]
67 | procedure TearDown;
68 |
69 | // Sample Methods
70 | // Simple single Test
71 | //[Test]
72 | //procedure Test1;
73 | // Test with TestCase Atribute to supply parameters.
74 | //[Test]
75 | //[TestCase('TestA','1,2')]
76 | //[TestCase('TestB','3,4')]
77 | //procedure Test2(const AValue1 : Integer;const AValue2 : Integer);
78 |
79 | [Test]
80 | procedure GetAccessToken;
81 |
82 | [Test]
83 | procedure ListFolders;
84 | end;
85 |
86 | implementation
87 |
88 | uses
89 | System.SysUtils;
90 |
91 | procedure TADLSUnitTest.GetAccessToken;
92 | var
93 | LADLSFakeView: TADLSFakeView;
94 | begin
95 | LADLSFakeView := TADLSFakeView.Create(FBaseURL, FClientID, FClientSecret,
96 | FAccessTokenEndpoint, FAuthorizationEndpoint, FFMBaseURL);
97 |
98 | try
99 | LADLSFakeView.GetAccessToken;
100 |
101 | if (LADLSFakeView.FADLSConnectorP.AccessToken = '') then
102 | raise Exception.Create('Error retrieving the access token');
103 | finally
104 | //LADLSFakeView.Free;
105 | end;
106 | end;
107 |
108 | procedure TADLSUnitTest.ListFolders;
109 | var
110 | LADLSFakeView: TADLSFakeView;
111 | begin
112 | LADLSFakeView := TADLSFakeView.Create(FBaseURL, FClientID, FClientSecret,
113 | FAccessTokenEndpoint, FAuthorizationEndpoint, FFMBaseURL);
114 | try
115 | LADLSFakeView.FADLSConnectorP.GetAccessToken;
116 |
117 | if (LADLSFakeView.FADLSConnectorP.AccessToken = '') then
118 | raise Exception.Create('Error retrieving the access token');
119 |
120 | LADLSFakeView.FADLSFileManagerP.ListFolders;
121 |
122 | if (LADLSFakeView.FADLSFileManagerP.GetListFolders.Text = '') then
123 | raise Exception.Create('Error retrieving the list folders');
124 | finally
125 | //LADLSFakeView.Free;
126 | end;
127 | end;
128 |
129 | procedure TADLSUnitTest.Setup;
130 | begin
131 | FBaseURL := '';
132 | FClientID := '';
133 | FClientSecret := '';
134 | FAccessTokenEndpoint := 'https://login.windows.net//oauth2/token';
135 | FAuthorizationEndpoint := '';
136 | FFMBaseURL := 'https://.azuredatalakestore.net';
137 | end;
138 |
139 | procedure TADLSUnitTest.TearDown;
140 | begin
141 | end;
142 |
143 | //procedure TADLSUnitTest.Test1;
144 | //begin
145 | //end;
146 |
147 | //procedure TADLSUnitTest.Test2(const AValue1 : Integer;const AValue2 : Integer);
148 | //begin
149 | //end;
150 |
151 | { TADLSFakeView }
152 |
153 | procedure TADLSFakeView.AddFMResponseData(const AValue: string);
154 | begin
155 | System.Write(AValue);
156 | end;
157 |
158 | procedure TADLSFakeView.AddResponseData(const AValue: string);
159 | begin
160 | System.Write(AValue);
161 | end;
162 |
163 | constructor TADLSFakeView.Create(const ABaseURL, AClientID, AClientSecret,
164 | AAccessTokenEndpoint, AAuthorizationEndpoint, AFMBaseURL: string);
165 | begin
166 | // Connector
167 | FBaseURL := ABaseURL;
168 | FClientID := AClientID;
169 | FClientSecret := AClientSecret;
170 | FAccessTokenEndpoint := AAccessTokenEndpoint;
171 | FAuthorizationEndpoint := AAuthorizationEndpoint;
172 |
173 | // File Manager
174 | FFMBaseURL := AFMBaseURL;
175 | FFMDirectories := TList.Create;
176 |
177 | FADLSConnectorP := TADLSConnectorPresenter.Create(Self);
178 | FADLSFileManagerP := TADLSFileManagerPresenter.Create(FADLSConnectorP, Self);
179 | end;
180 |
181 | //destructor TADLSFakeView.Destroy;
182 | //begin
183 | // // Interfaces are released automatically
184 | // //FADLSFileManagerP.Free;
185 | // //FADLSConnectorP.Free;
186 | //
187 | // inherited;
188 | //end;
189 |
190 | procedure TADLSFakeView.DisplayFMMessage(AValue: string);
191 | begin
192 | System.Write(AValue);
193 | end;
194 |
195 | procedure TADLSFakeView.GetAccessToken;
196 | begin
197 | FADLSConnectorP.GetAccessToken;
198 | end;
199 |
200 | function TADLSFakeView.GetAccessTokenEndpoint: string;
201 | begin
202 | Result := FAccessTokenEndpoint;
203 | end;
204 |
205 | function TADLSFakeView.GetAuthorizationEndpoint: string;
206 | begin
207 | Result := FAuthorizationEndpoint;
208 | end;
209 |
210 | function TADLSFakeView.GetBaseURL: string;
211 | begin
212 | Result := FBaseURL;
213 | end;
214 |
215 | function TADLSFakeView.GetClientID: string;
216 | begin
217 | Result := FClientID;
218 | end;
219 |
220 | function TADLSFakeView.GetClientSecret: string;
221 | begin
222 | Result := FClientSecret;
223 | end;
224 |
225 | function TADLSFakeView.GetFMBaseURL: string;
226 | begin
227 | Result := FFMBaseURL;
228 | end;
229 |
230 | function TADLSFakeView.GetFMDirectory: string;
231 | begin
232 |
233 | end;
234 |
235 | function TADLSFakeView.GetFMFilePath: string;
236 | begin
237 |
238 | end;
239 |
240 | procedure TADLSFakeView.SetAccessToken(const AValue: string);
241 | begin
242 | System.Write('');
243 | System.Write('Access token..');
244 | System.Write(AValue);
245 | end;
246 |
247 | procedure TADLSFakeView.SetFMDirectory(AValue: TList);
248 | var
249 | i: Integer;
250 | begin
251 | FFMDirectories.Clear;
252 |
253 | for i := 0 to AValue.Count - 1 do
254 | FFMDirectories.Add(AValue.Items[i]);
255 | end;
256 |
257 | procedure TADLSFakeView.SetFMResponseData(const AValue: string);
258 | begin
259 |
260 | end;
261 |
262 | procedure TADLSFakeView.SetResponseData(const AValue: string);
263 | begin
264 | System.Write('');
265 | System.Write(GetBaseURL);
266 | System.Write(AValue);
267 | end;
268 |
269 | initialization
270 | TDUnitX.RegisterTestFixture(TADLSUnitTest);
271 |
272 | end.
273 |
--------------------------------------------------------------------------------
/ADL Store Library for Delphi/Sources/UnitTest/ADLStoreLibrary4DUnitTest.dpr:
--------------------------------------------------------------------------------
1 | program ADLStoreLibrary4DUnitTest;
2 |
3 | {$IFNDEF TESTINSIGHT}
4 | {$APPTYPE CONSOLE}
5 | {$ENDIF}{$STRONGLINKTYPES ON}
6 | uses
7 | SysUtils,
8 | {$IFDEF TESTINSIGHT}
9 | TestInsight.DUnitX,
10 | {$ENDIF }
11 | DUnitX.Loggers.Console,
12 | DUnitX.Loggers.Xml.NUnit,
13 | DUnitX.TestFramework,
14 | ADLSUnitTest.Classes in 'ADLSUnitTest.Classes.pas',
15 | ADLSConnector.Interfaces in '..\Connector\ADLSConnector.Interfaces.pas',
16 | ADLSFileManager.Interfaces in '..\File Manager\ADLSFileManager.Interfaces.pas',
17 | ADLSConnector.Presenter in '..\Connector\ADLSConnector.Presenter.pas',
18 | ADLSFileManager.Presenter in '..\File Manager\ADLSFileManager.Presenter.pas',
19 | IPPeerClient;
20 |
21 | var
22 | runner : ITestRunner;
23 | results : IRunResults;
24 | logger : ITestLogger;
25 | nunitLogger : ITestLogger;
26 | begin
27 | {$IFDEF TESTINSIGHT}
28 | TestInsight.DUnitX.RunRegisteredTests;
29 | exit;
30 | {$ENDIF}
31 | try
32 | //Check command line options, will exit if invalid
33 | TDUnitX.CheckCommandLine;
34 | //Create the test runner
35 | runner := TDUnitX.CreateRunner;
36 | //Tell the runner to use RTTI to find Fixtures
37 | runner.UseRTTI := True;
38 | //tell the runner how we will log things
39 | //Log to the console window
40 | logger := TDUnitXConsoleLogger.Create(true);
41 | runner.AddLogger(logger);
42 | //Generate an NUnit compatible XML File
43 | nunitLogger := TDUnitXXMLNUnitFileLogger.Create(TDUnitX.Options.XMLOutputFile);
44 | runner.AddLogger(nunitLogger);
45 | runner.FailsOnNoAsserts := False; //When true, Assertions must be made during tests;
46 |
47 | //Run tests
48 | results := runner.Execute;
49 | if not results.AllPassed then
50 | System.ExitCode := EXIT_ERRORS;
51 |
52 | {$IFNDEF CI}
53 | //We don't want this happening when running under CI.
54 | if TDUnitX.Options.ExitBehavior = TDUnitXExitBehavior.Pause then
55 | begin
56 | System.Write('Done.. press key to quit.');
57 | System.Readln;
58 | end;
59 | {$ENDIF}
60 | except
61 | on E: Exception do
62 | System.Writeln(E.ClassName, ': ', E.Message);
63 | end;
64 | end.
65 |
--------------------------------------------------------------------------------
/ADL Store Library for Delphi/Sources/UnitTest/ADLStoreLibrary4DUnitTest.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {38E2765E-97FB-4A57-AD07-CEB243781343}
4 | 18.1
5 | ADLStoreLibrary4DUnitTest.dpr
6 | True
7 | Debug
8 | Win32
9 | 1
10 | Console
11 | None
12 |
13 |
14 | true
15 |
16 |
17 | true
18 | Base
19 | true
20 |
21 |
22 | true
23 | Base
24 | true
25 |
26 |
27 | true
28 | Base
29 | true
30 |
31 |
32 | true
33 | Base
34 | true
35 |
36 |
37 | true
38 | Base
39 | true
40 |
41 |
42 | true
43 | Base
44 | true
45 |
46 |
47 | true
48 | Base
49 | true
50 |
51 |
52 | true
53 | Base
54 | true
55 |
56 |
57 | true
58 | Cfg_1
59 | true
60 | true
61 |
62 |
63 | true
64 | Base
65 | true
66 |
67 |
68 | $(DUnitX);$(DCC_UnitSearchPath)
69 | true
70 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)
71 | $(BDS)\bin\delphi_PROJECTICON.ico
72 | $(BDS)\bin\delphi_PROJECTICNS.icns
73 | ADLStoreLibrary4DUnitTest
74 | .\$(Platform)\$(Config)
75 | .\$(Platform)\$(Config)
76 | false
77 | false
78 | false
79 | false
80 | false
81 |
82 |
83 | android-support-v4.dex.jar;apk-expansion.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar
84 | DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage)
85 |
86 |
87 | DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage)
88 |
89 |
90 | DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage)
91 |
92 |
93 | DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage)
94 |
95 |
96 | DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;FireDACMSSQLDriver;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;bindcomp;DBXInformixDriver;IndyIPClient;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage)
97 |
98 |
99 | 1033
100 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
101 | DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;CSData;DataSnapFireDAC;svnui;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;Intraweb;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyCore;tmsexdXE10;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;CSExtra;VCLRESTComponents;soapserver;CSAppControls;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;DBXSybaseASEDriver;IndyIPServer;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;CSControls;tmsdXE10;fmxase;$(DCC_UsePackage)
102 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=
103 |
104 |
105 | DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;Intraweb;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyCore;tmsexdXE10;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;DBXSybaseASEDriver;IndyIPServer;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;tmsdXE10;fmxase;$(DCC_UsePackage)
106 |
107 |
108 | DEBUG;$(DCC_Define)
109 | true
110 | false
111 | true
112 | true
113 | true
114 |
115 |
116 | 1033
117 | None
118 | false
119 |
120 |
121 | false
122 | RELEASE;$(DCC_Define)
123 | 0
124 | 0
125 |
126 |
127 |
128 | MainSource
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | Cfg_2
137 | Base
138 |
139 |
140 | Base
141 |
142 |
143 | Cfg_1
144 | Base
145 |
146 |
147 |
148 | Delphi.Personality.12
149 | Console
150 |
151 |
152 |
153 | ADLStoreLibrary4DUnitTest.dpr
154 |
155 |
156 | Embarcadero C++Builder Office 2000 Servers Package
157 | Embarcadero C++Builder Office XP Servers Package
158 | Microsoft Office 2000 Sample Automation Server Wrapper Components
159 | Microsoft Office XP Sample Automation Server Wrapper Components
160 |
161 |
162 |
163 |
164 |
165 | true
166 |
167 |
168 |
169 |
170 | true
171 |
172 |
173 |
174 |
175 | true
176 |
177 |
178 |
179 |
180 | ADLStoreLibrary4DUnitTest.exe
181 | true
182 |
183 |
184 |
185 |
186 |
187 | Contents\Resources
188 | 1
189 |
190 |
191 |
192 |
193 | classes
194 | 1
195 |
196 |
197 |
198 |
199 | Contents\MacOS
200 | 0
201 |
202 |
203 | 1
204 |
205 |
206 |
207 |
208 | 1
209 |
210 |
211 | 1
212 |
213 |
214 | 1
215 |
216 |
217 |
218 |
219 | res\drawable-xxhdpi
220 | 1
221 |
222 |
223 |
224 |
225 | library\lib\mips
226 | 1
227 |
228 |
229 |
230 |
231 | 0
232 |
233 |
234 | 1
235 |
236 |
237 | 1
238 |
239 |
240 | 1
241 |
242 |
243 | library\lib\armeabi-v7a
244 | 1
245 |
246 |
247 | 1
248 |
249 |
250 |
251 |
252 | 0
253 |
254 |
255 | 1
256 | .framework
257 |
258 |
259 |
260 |
261 | 1
262 |
263 |
264 | 1
265 |
266 |
267 | 1
268 |
269 |
270 |
271 |
272 | 1
273 |
274 |
275 | 1
276 |
277 |
278 | 1
279 |
280 |
281 |
282 |
283 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
284 | 1
285 |
286 |
287 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
288 | 1
289 |
290 |
291 |
292 |
293 | library\lib\x86
294 | 1
295 |
296 |
297 |
298 |
299 | 1
300 |
301 |
302 | 1
303 |
304 |
305 | 1
306 |
307 |
308 |
309 |
310 |
311 | library\lib\armeabi
312 | 1
313 |
314 |
315 |
316 |
317 | 0
318 |
319 |
320 | 1
321 |
322 |
323 | 1
324 |
325 |
326 |
327 |
328 | 1
329 |
330 |
331 | 1
332 |
333 |
334 | 1
335 |
336 |
337 |
338 |
339 | res\drawable-normal
340 | 1
341 |
342 |
343 |
344 |
345 | res\drawable-xhdpi
346 | 1
347 |
348 |
349 |
350 |
351 | res\drawable-large
352 | 1
353 |
354 |
355 |
356 |
357 | 1
358 |
359 |
360 | 1
361 |
362 |
363 | 1
364 |
365 |
366 |
367 |
368 |
369 | res\drawable-hdpi
370 | 1
371 |
372 |
373 |
374 |
375 | library\lib\armeabi-v7a
376 | 1
377 |
378 |
379 |
380 |
381 |
382 |
383 | 1
384 |
385 |
386 | 1
387 |
388 |
389 | 1
390 |
391 |
392 |
393 |
394 | res\values
395 | 1
396 |
397 |
398 |
399 |
400 | res\drawable-small
401 | 1
402 |
403 |
404 |
405 |
406 | res\drawable
407 | 1
408 |
409 |
410 |
411 |
412 | 1
413 |
414 |
415 | 1
416 |
417 |
418 | 1
419 |
420 |
421 |
422 |
423 | 1
424 |
425 |
426 |
427 |
428 | res\drawable
429 | 1
430 |
431 |
432 |
433 |
434 | 0
435 |
436 |
437 | 0
438 |
439 |
440 | 0
441 |
442 |
443 | 0
444 |
445 |
446 | 0
447 |
448 |
449 | 0
450 |
451 |
452 |
453 |
454 | library\lib\armeabi-v7a
455 | 1
456 |
457 |
458 |
459 |
460 | 0
461 | .bpl
462 |
463 |
464 | 1
465 | .dylib
466 |
467 |
468 | 1
469 | .dylib
470 |
471 |
472 | 1
473 | .dylib
474 |
475 |
476 | 1
477 | .dylib
478 |
479 |
480 |
481 |
482 | res\drawable-mdpi
483 | 1
484 |
485 |
486 |
487 |
488 | res\drawable-xlarge
489 | 1
490 |
491 |
492 |
493 |
494 | res\drawable-ldpi
495 | 1
496 |
497 |
498 |
499 |
500 | 0
501 | .dll;.bpl
502 |
503 |
504 | 1
505 | .dylib
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 | False
518 | False
519 | False
520 | False
521 | False
522 | True
523 | False
524 |
525 |
526 | 12
527 |
528 |
529 |
530 |
531 |
532 |
--------------------------------------------------------------------------------
/ADL Store Library for Delphi/Sources/View/ADLSMain.dfm:
--------------------------------------------------------------------------------
1 | object frmADLSMain: TfrmADLSMain
2 | Left = 0
3 | Top = 0
4 | Caption = 'Azure Data Lake Store Library for Delphi'
5 | ClientHeight = 517
6 | ClientWidth = 828
7 | Color = clBtnFace
8 | Font.Charset = DEFAULT_CHARSET
9 | Font.Color = clWindowText
10 | Font.Height = -11
11 | Font.Name = 'Tahoma'
12 | Font.Style = []
13 | OldCreateOrder = False
14 | OnClose = FormClose
15 | OnCreate = FormCreate
16 | PixelsPerInch = 96
17 | TextHeight = 13
18 | object pnlHeader: TPanel
19 | Left = 0
20 | Top = 0
21 | Width = 828
22 | Height = 57
23 | Align = alTop
24 | TabOrder = 0
25 | object imgAzureDataLake: TImage
26 | Left = 1
27 | Top = 1
28 | Width = 50
29 | Height = 50
30 | Align = alLeft
31 | AutoSize = True
32 | Picture.Data = {
33 | 0954506E67496D61676589504E470D0A1A0A0000000D49484452000000320000
34 | 003208060000001E3F88B1000000017352474200AECE1CE90000000467414D41
35 | 0000B18F0BFC61050000059F4944415478DAED9A7B6CD35514C7BFBF47DF2D5D
36 | D75637E81E08BAA9236489822C5BCAC68C8C113316A390284A82FE6390C4F8CF
37 | FE208A0989A2C41813498484FF14A306FC8357C46C26441C1835D9CCC63626B2
38 | 8763DDA3DBFAFC3D3DBF1FEBDCD80AEBCA12627E673939F7DEDFBDE79ECF3DE7
39 | B66957065988AAAA56D2326A3EC3308C8FDA0F53DB491A20CD99D6C0F4F47ED2
40 | F0B46AED08ADB9456B46A8FD0BB5DB49134B8D85C930705E0B9A6C3DD9EDA4A5
41 | B4399FCD61CCF22D9169273D4F3E2F90BD4456BAAF208AA29490D31DB45903D9
42 | 8DA9F1B8184277E824C663ED880BFD10E5516D36A9A83B36B1EC1C3FA2A240D5
43 | 5B2652163CE781DD5C088FBD0C8FFA77C266F2CF06FB8DCC29D2D32CCBB66705
44 | 325D3A7BA9B99700D66B6313895EB40D7E8AF1E8CF14A84C0E324A6AFABDE84F
45 | 5438E4D837A0BCA0094E732015430799E39A12D0E4924028135F11C04EAD2D2B
46 | 493477EF8120768063582CA7C8AA02ABB90CC1B5C7C1B19614D0B714CBAE74E5
47 | 96168420DEA1451FA5FA67FF7C0E1C469615601E107CD8F6E485993EC17C4059
48 | 69CA08241289B4391C8EB254FF4C5B397876793371A74874A7EAD7FD3ED31745
49 | B1D76C36AFC908A4A5A525120C061DA9FEC56BBB204B5D693715151109498020
50 | 8B48CA49BD3C668B568E2696A7C3E0F5B685B78065181A33A5F5C972C578B6F4
51 | BB997E7FFF80585010306704B27FFFFE7F8E1C3992C771DCCC58EBDFEF6178F2
52 | 34CC2C87A818C758224C368629214AA7B7E857CA39A281B9CC0E384C7678AC6E
53 | 38C96A99F0B9B66163F1A199795456686EF929BAA5A6DA9911485555D55F9B37
54 | 6F2E6E6A6A82CD669B19979418BA474EA163F83C7A472F22220C2D09E04E719A
55 | F3F088B716A5FE3A3CE66F2040FBCC335996D17AE50ABABB7BC2AFBDBADB9331
56 | 085DF662BFDF8F7DFBF6A1B2B212B3B393929168A7AE63F11EB2D7A0D0FBDA64
57 | A25FB7E1C48D397373ACC5544E3C565803BACDB5AF81CF5E0A9FE3B62E2437FB
58 | FA70F5EAAFDA9DD5BA4B0749F5F3F2F2D0D8D8889A9A1A6870CB29F1785C07E8
59 | E8E8C4C4C4C4EC47D983CC96929212545454E856D3DCDCDCAC024F2693088542
60 | 181B1BC7C0E020868787D34DBDBF20778ADBEDD66134EB743A75D5FA168B0585
61 | 8585282C2AD24B43BBB0B1680CA224219948D09BAB40A79FD033B048595E90BB
62 | 497E7E3EEAB6D567EBC60031400C1003C40031400C1003C40031401E1010D5EE
63 | 0656F8C10CF564043260F1635532B4BC209575CFF7B1D17000F712DE0CA9F60D
64 | A8EE87C09FFB0CCCE4DCC0D281F4D856E1BA3D80C7A3375098B8B5288A28679D
65 | 7CF3E517DD19816C3A7C5AE0BA2E9BD8AECB691DAB0E0FE4E02B503D2B6F0F48
66 | 02F84B5F8219E84C0B22331C3A1C457A36525294184249F42605A32EBC0F3DE9
67 | B21720CC3BA5A33B9E5AF0FBA3F4209F9C1561CFE1B57261073AC08C0E80191F
68 | 846AB6E965A414AD87B2BA1CE0E67F19CFDCEA057BFD2AADE947BECB82DABAED
69 | 88F076844C393A80C8CE5F6355043D335E71025639A98F4D989C5AF01836E722
70 | C2D990234E2D1D645139BF8B38E323F0AD2DC9D6CD6D5F524C3ED650BE604C06
71 | 88016280182006C8FF142441206B0C1003E43F90C3DF47E0F63B90A5B8847178
72 | 57AFBD2F201E7122FAF98E0D99FDEBADE2C0F1736AE089AD0F12486162E8C70F
73 | 5F08D66604127CB79917ACA37DC85D99F72080788570C8EB89AD3C585D9DD90F
74 | 063479FA446B9EA9B7ED989A935F0FA76749BFD5C8F6E5D72EC5458F3CF5835B
75 | 08BD756057E3F574F31615DCA643DF6C6192934DAACB57459F45CC8B59932D88
76 | 4B8A46E972B73A65E18BF75FAAF9FA5EF3333AE5E08966ABD8D9FEBA6A73ED86
77 | D3BB0E2EAFE59E012DB2B4B44F8776291173CAF13F2C72ECA4D5CF1E4D574659
78 | 83CC037BFB639FC8B10D0C6FD9AA329C17169B0F0CE780C9EA56CD160B8D5956
79 | 50FEFC45AB79932249BC2A0B1C64C1A4CAA31C9438A32823264883BC2A9E314F
80 | B1670FEEA90E2F35967F011407DC51367C7D900000000049454E44AE426082}
81 | ExplicitHeight = 126
82 | end
83 | end
84 | object pgcMain: TPageControl
85 | Left = 0
86 | Top = 57
87 | Width = 528
88 | Height = 436
89 | ActivePage = tsConnector
90 | Align = alClient
91 | TabOrder = 1
92 | object tsConnector: TTabSheet
93 | Caption = 'Connector'
94 | ExplicitLeft = 0
95 | ExplicitTop = 0
96 | ExplicitWidth = 0
97 | ExplicitHeight = 0
98 | object sbConnector: TScrollBox
99 | Left = 0
100 | Top = 0
101 | Width = 520
102 | Height = 408
103 | HorzScrollBar.Style = ssFlat
104 | VertScrollBar.Style = ssFlat
105 | Align = alClient
106 | BorderStyle = bsNone
107 | Color = clWhite
108 | ParentColor = False
109 | TabOrder = 0
110 | object edt_Connector_AccessTokenEndpoint: TLabeledEdit
111 | Left = 4
112 | Top = 24
113 | Width = 500
114 | Height = 21
115 | EditLabel.Width = 110
116 | EditLabel.Height = 13
117 | EditLabel.Caption = 'Access Token Endpoint'
118 | TabOrder = 0
119 | Text = 'https://login.windows.net//oauth2/token'
120 | end
121 | object edt_Connector_ClientID: TLabeledEdit
122 | Left = 4
123 | Top = 72
124 | Width = 500
125 | Height = 21
126 | EditLabel.Width = 41
127 | EditLabel.Height = 13
128 | EditLabel.Caption = 'Client ID'
129 | ParentShowHint = False
130 | ShowHint = False
131 | TabOrder = 1
132 | TextHint = 'Application ID (Client ID)'
133 | end
134 | object edt_Connector_ClientSecret: TLabeledEdit
135 | Left = 4
136 | Top = 117
137 | Width = 500
138 | Height = 21
139 | EditLabel.Width = 61
140 | EditLabel.Height = 13
141 | EditLabel.Caption = 'Client Secret'
142 | TabOrder = 2
143 | TextHint = 'Authentication key value'
144 | end
145 | object edt_Connector_AccessToken: TLabeledEdit
146 | Left = 4
147 | Top = 216
148 | Width = 500
149 | Height = 21
150 | EditLabel.Width = 65
151 | EditLabel.Height = 13
152 | EditLabel.Caption = 'Access Token'
153 | Enabled = False
154 | TabOrder = 4
155 | end
156 | object edt_Connector_AuthCode: TLabeledEdit
157 | Left = 4
158 | Top = 257
159 | Width = 500
160 | Height = 21
161 | EditLabel.Width = 51
162 | EditLabel.Height = 13
163 | EditLabel.Caption = 'Auth Code'
164 | ReadOnly = True
165 | TabOrder = 5
166 | end
167 | object edt_Connector_BaseURL: TLabeledEdit
168 | Left = 4
169 | Top = 308
170 | Width = 500
171 | Height = 21
172 | EditLabel.Width = 45
173 | EditLabel.Height = 13
174 | EditLabel.Caption = 'Base URL'
175 | TabOrder = 6
176 | Text =
177 | 'https://login.microsoftonline.com//oaut' +
178 | 'h2/token'
179 | end
180 | object edt_Connector_AuthorizationEndpoint: TLabeledEdit
181 | Left = 4
182 | Top = 356
183 | Width = 500
184 | Height = 21
185 | EditLabel.Width = 109
186 | EditLabel.Height = 13
187 | EditLabel.Caption = 'Authorization Endpoint'
188 | TabOrder = 7
189 | Text =
190 | 'https://login.windows.net//oauth2/autho' +
191 | 'rize'
192 | end
193 | object btnGetToken: TButton
194 | Left = 354
195 | Top = 144
196 | Width = 150
197 | Height = 58
198 | Caption = 'Get Token'
199 | TabOrder = 3
200 | OnClick = btnGetTokenClick
201 | end
202 | end
203 | end
204 | object tsFileManager: TTabSheet
205 | Caption = 'File Manager'
206 | ImageIndex = 1
207 | object lblFolder: TLabel
208 | Left = 4
209 | Top = 55
210 | Width = 28
211 | Height = 13
212 | Caption = 'Foder'
213 | end
214 | object edt_FilePath: TLabeledEdit
215 | Left = 4
216 | Top = 125
217 | Width = 381
218 | Height = 21
219 | EditLabel.Width = 41
220 | EditLabel.Height = 13
221 | EditLabel.Caption = 'File Path'
222 | TabOrder = 0
223 | TextHint = 'Select a file.. use file selector button..'
224 | end
225 | object btnOpenFile: TButton
226 | Left = 391
227 | Top = 123
228 | Width = 113
229 | Height = 25
230 | Caption = 'Select file to upload..'
231 | TabOrder = 1
232 | OnClick = btnOpenFileClick
233 | end
234 | object btnUpload: TButton
235 | Left = 312
236 | Top = 163
237 | Width = 192
238 | Height = 38
239 | Caption = 'Upload'
240 | TabOrder = 2
241 | OnClick = btnUploadClick
242 | end
243 | object edt_FileManager_BaseURL: TLabeledEdit
244 | Left = 4
245 | Top = 24
246 | Width = 500
247 | Height = 21
248 | EditLabel.Width = 45
249 | EditLabel.Height = 13
250 | EditLabel.Caption = 'Base URL'
251 | TabOrder = 3
252 | Text = 'https://.azuredatalakestore.net'
253 | end
254 | object cbxADLSFolder: TComboBox
255 | Left = 4
256 | Top = 74
257 | Width = 381
258 | Height = 21
259 | TabOrder = 4
260 | TextHint = 'ADLS Folder.. use folder selector button..'
261 | end
262 | object btnFillCbxDirectory: TButton
263 | Left = 391
264 | Top = 72
265 | Width = 113
266 | Height = 25
267 | Caption = 'Get folders list..'
268 | TabOrder = 5
269 | OnClick = btnFillCbxDirectoryClick
270 | end
271 | end
272 | end
273 | object sbResponse: TScrollBox
274 | Left = 528
275 | Top = 57
276 | Width = 300
277 | Height = 436
278 | VertScrollBar.Style = ssFlat
279 | Align = alRight
280 | Anchors = [akLeft, akTop, akRight, akBottom]
281 | BorderStyle = bsNone
282 | TabOrder = 2
283 | object memoResponseData: TMemo
284 | Left = 0
285 | Top = 0
286 | Width = 300
287 | Height = 436
288 | Align = alClient
289 | Lines.Strings = (
290 | 'memoResponseData')
291 | TabOrder = 0
292 | end
293 | end
294 | object pnlFooter: TPanel
295 | Left = 0
296 | Top = 493
297 | Width = 828
298 | Height = 24
299 | Align = alBottom
300 | TabOrder = 3
301 | end
302 | object odSelectFile: TOpenDialog
303 | Left = 652
304 | Top = 129
305 | end
306 | end
307 |
--------------------------------------------------------------------------------
/ADL Store Library for Delphi/Sources/View/ADLSMain.pas:
--------------------------------------------------------------------------------
1 | ///
2 | /// From Microsoft Docs: Azure Data Lake Store is an enterprise-wide
3 | /// hyper-scale repository for big data analytic workloads. Azure Data Lake
4 | /// enables you to capture data of any size, type, and ingestion speed in one
5 | /// single place for operational and exploratory analytics
6 | ///
7 | ///
8 | /// Some useful links:
9 | ///
10 | /// -
11 | ///
12 | /// Overview of Azure Data Lake Store
13 | ///
14 | ///
15 | ///
16 | unit ADLSMain;
17 |
18 | interface
19 |
20 | uses
21 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
22 | System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
23 | Vcl.StdCtrls, Vcl.ExtCtrls, ADLSConnector.Interfaces, ADLSConnector.Presenter,
24 | ADLSFileManager.Interfaces, ADLSFileManager.Presenter, IPPeerClient,
25 | REST.Response.Adapter, REST.Client, Data.Bind.Components, Data.Bind.ObjectScope,
26 | Vcl.ComCtrls, Vcl.Imaging.pngimage, System.Generics.Collections;
27 |
28 | type
29 | TfrmADLSMain= class(TForm, IADLSConnectorView, IADLSFileManagerView)
30 | pnlHeader: TPanel;
31 | pgcMain: TPageControl;
32 | tsConnector: TTabSheet;
33 | tsFileManager: TTabSheet;
34 | sbConnector: TScrollBox;
35 | edt_Connector_AccessTokenEndpoint: TLabeledEdit;
36 | edt_Connector_ClientID: TLabeledEdit;
37 | edt_Connector_ClientSecret: TLabeledEdit;
38 | edt_Connector_AccessToken: TLabeledEdit;
39 | edt_Connector_AuthCode: TLabeledEdit;
40 | edt_Connector_BaseURL: TLabeledEdit;
41 | edt_Connector_AuthorizationEndpoint: TLabeledEdit;
42 | edt_FilePath: TLabeledEdit;
43 | edt_FileManager_BaseURL: TLabeledEdit;
44 | btnGetToken: TButton;
45 | btnOpenFile: TButton;
46 | btnUpload: TButton;
47 | odSelectFile: TOpenDialog;
48 | imgAzureDataLake: TImage;
49 | sbResponse: TScrollBox;
50 | memoResponseData: TMemo;
51 | cbxADLSFolder: TComboBox;
52 | lblFolder: TLabel;
53 | btnFillCbxDirectory: TButton;
54 | pnlFooter: TPanel;
55 | procedure FormCreate(Sender: TObject);
56 | procedure btnGetTokenClick(Sender: TObject);
57 | procedure Button1Click(Sender: TObject);
58 | procedure btnOpenFileClick(Sender: TObject);
59 | procedure btnUploadClick(Sender: TObject);
60 | procedure FormClose(Sender: TObject; var Action: TCloseAction);
61 | procedure btnFillCbxDirectoryClick(Sender: TObject);
62 | private const
63 | APP_TITLE = 'Azure Data Lake Store Library for Delphi';
64 | private
65 | FADLSConnectorPresenter: TADLSConnectorPresenter;
66 | FADLSFileManagerPresenter: TADLSFileManagerPresenter;
67 | public
68 | // Input connector
69 | function GetBaseURL: string;
70 | function GetClientID: string;
71 | function GetClientSecret: string;
72 | function GetAccessTokenEndpoint: string;
73 | function GetAuthorizationEndpoint: string;
74 | // Input file manager
75 | function GetFMBaseURL: string;
76 | function GetFMDirectory: string;
77 | function GetFMFilePath: string;
78 | // Output connector
79 | procedure SetAccessToken(const AValue: string);
80 | procedure SetResponseData(const AValue: string);
81 | procedure AddResponseData(const AValue: string);
82 | // Output file manager
83 | procedure DisplayFMMessage(AValue: string);
84 | procedure SetFMDirectory(AValue: TList);
85 | procedure SetFMResponseData(const AValue: string);
86 | procedure AddFMResponseData(const AValue: string);
87 | end;
88 |
89 | var
90 | frmADLSMain: TfrmADLSMain;
91 |
92 | implementation
93 |
94 | {$R *.dfm}
95 |
96 | { TfrmADLSConnector }
97 |
98 | procedure TfrmADLSMain.AddFMResponseData(const AValue: string);
99 | begin
100 | memoResponseData.Lines.Add(AValue);
101 | end;
102 |
103 | procedure TfrmADLSMain.AddResponseData(const AValue: string);
104 | begin
105 | memoResponseData.Lines.Add(AValue);
106 | end;
107 |
108 | procedure TfrmADLSMain.btnFillCbxDirectoryClick(Sender: TObject);
109 | begin
110 | FADLSFileManagerPresenter.ListFolders;
111 | end;
112 |
113 | procedure TfrmADLSMain.btnGetTokenClick(Sender: TObject);
114 | begin
115 | FADLSConnectorPresenter.GetAccessToken;
116 | end;
117 |
118 | procedure TfrmADLSMain.btnOpenFileClick(Sender: TObject);
119 | begin
120 | odSelectFile.Filter := 'JSON and TXT files (*.json; *.txt)|*.json; *.txt';
121 | odSelectFile.FilterIndex := 2;
122 | if odSelectFile.Execute then
123 | edt_FilePath.Text := odSelectFile.FileName;
124 | end;
125 |
126 | procedure TfrmADLSMain.btnUploadClick(Sender: TObject);
127 | begin
128 | FADLSFileManagerPresenter.UploadFile;
129 | end;
130 |
131 | procedure TfrmADLSMain.Button1Click(Sender: TObject);
132 | begin
133 | FADLSFileManagerPresenter.GetListFolders;
134 | end;
135 |
136 | procedure TfrmADLSMain.DisplayFMMessage(AValue: string);
137 | begin
138 | Application.MessageBox(PChar(AValue), PChar(APP_TITLE), MB_OK);
139 | end;
140 |
141 | procedure TfrmADLSMain.FormClose(Sender: TObject; var Action: TCloseAction);
142 | begin
143 | FADLSFileManagerPresenter.Free;
144 | FADLSConnectorPresenter.Free;
145 | end;
146 |
147 | procedure TfrmADLSMain.FormCreate(Sender: TObject);
148 | begin
149 | FADLSConnectorPresenter := TADLSConnectorPresenter.Create(Self);
150 | FADLSFileManagerPresenter := TADLSFileManagerPresenter.Create(FADLSConnectorPresenter, Self);
151 |
152 | SetResponseData('');
153 | end;
154 |
155 | function TfrmADLSMain.GetAccessTokenEndpoint: string;
156 | begin
157 | Result := edt_Connector_AccessTokenEndpoint.Text;
158 | end;
159 |
160 | function TfrmADLSMain.GetAuthorizationEndpoint: string;
161 | begin
162 | Result := edt_Connector_AuthorizationEndpoint.Text
163 | end;
164 |
165 | function TfrmADLSMain.GetBaseURL: string;
166 | begin
167 | Result := edt_Connector_BaseURL.Text;
168 | end;
169 |
170 | function TfrmADLSMain.GetClientID: string;
171 | begin
172 | Result := edt_Connector_ClientID.Text;
173 | end;
174 |
175 | function TfrmADLSMain.GetClientSecret: string;
176 | begin
177 | Result := edt_Connector_ClientSecret.Text;
178 | end;
179 |
180 | function TfrmADLSMain.GetFMDirectory: string;
181 | begin
182 | Result := cbxADLSFolder.Text;
183 | end;
184 |
185 | function TfrmADLSMain.GetFMBaseURL: string;
186 | begin
187 | Result := edt_FileManager_BaseURL.Text;
188 | end;
189 |
190 | function TfrmADLSMain.GetFMFilePath: string;
191 | begin
192 | Result := edt_FilePath.Text
193 | end;
194 |
195 | procedure TfrmADLSMain.SetAccessToken(const AValue: string);
196 | begin
197 | edt_Connector_AccessToken.Text := AValue;
198 | end;
199 |
200 | procedure TfrmADLSMain.SetFMDirectory(AValue: TList);
201 | var
202 | i: Integer;
203 | begin
204 | cbxADLSFolder.Clear;
205 | cbxADLSFolder.Sorted := True;
206 |
207 | for i := 0 to AValue.Count - 1 do
208 | cbxADLSFolder.Items.Add(AValue.Items[i]);
209 | end;
210 |
211 | procedure TfrmADLSMain.SetFMResponseData(const AValue: string);
212 | begin
213 | memoResponseData.Lines.Text := AValue;
214 | end;
215 |
216 | procedure TfrmADLSMain.SetResponseData(const AValue: string);
217 | begin
218 | memoResponseData.Lines.Text := AValue;
219 | end;
220 |
221 | end.
222 |
--------------------------------------------------------------------------------
/ADL Store Library for Delphi/img/ADLSLibrary4D_Connector.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/segovoni/azure-data-lake-store-delphi/3e8af19e6bb4982bbbee37382fd17a9f379afc14/ADL Store Library for Delphi/img/ADLSLibrary4D_Connector.png
--------------------------------------------------------------------------------
/ADL Store Library for Delphi/img/ADLSLibrary4D_FileManager.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/segovoni/azure-data-lake-store-delphi/3e8af19e6bb4982bbbee37382fd17a9f379afc14/ADL Store Library for Delphi/img/ADLSLibrary4D_FileManager.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Azure Data Lake Store library for Delphi
2 |
3 | From [Microsoft-Docs](https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/data-lake-store/data-lake-store-overview.md): Azure Data Lake Store is an enterprise-wide hyper-scale repository for big data analytic workloads. Azure Data Lake enables you to capture data of any size, type, and ingestion speed in one single place for operational and exploratory analytics.
4 |
5 | ## Introduction
6 |
7 | Because I'm a Delphi developer, Microsoft Data Platform MVP since 2010 and because there are poor documentation about the integration between the Delphi programming language and Microsoft Azure services, I decided to do something for help Delphi developers to use Microsoft services and products. I developed a REST library to connect and manage files in an instance of Azure Data Lake Store.
8 |
9 | This library is intended for Delphi developers who want to build applications or services that are able to connect to an instance of Azure Data Lake Store, retrieve an access token, upload data to the store, retrieve folder list and so on.
10 |
11 | The library has been developped using Model View Presenter design pattern.
12 |
13 | # Getting Started
14 |
15 | This section explains how to getting start to use the ADLSLibrary4D to connect to an Azure Data Lake instance and manage data.
16 |
17 | ## Prerequisites
18 |
19 | If you want to learn how to connect to an instance of Azure Data Lake from a Delphi application I suppose you already have an Azure subscription. Anyway, if you don't already have an Azure subscription, you can get one for free here: [get Azure free trial](https://azure.microsoft.com/en-us/free/).
20 |
21 | When your Azure subscription is ready to use, you have to create an Azure Active Directory "Web" Application, to do that, you must have completed the steps explained in [Service-to-service authentication with Data Lake Store using Azure Active Directory](https://docs.microsoft.com/en-us/azure/data-lake-store/data-lake-store-service-to-service-authenticate-using-active-directory).
22 |
23 | ## Service-to-service authentication
24 |
25 | To connect to an Azure Data Lake instance using service-to-service authentication, the application have to provides its own credentials to perform the operations. The application must send a POST request to the URL specified in the Access Token Endpoint field shown in the following picture. For the credentials, the application have to specify the Client ID and the Client Secret key that are provided during the creation of the [Azure Active Directory application and service principal](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal).
26 |
27 | In short words, the application can get an access token by a POST request to the URL specified in the Access Token Endpoint with credentials specified respectively in the fields Client ID and Client Secret as showing in the following picture. Replace "TENANTID or DIRECTORYID" in the Access Token Endpoint with the Tenant ID of your Azure active directory.
28 |
29 | 
30 |
31 | Using the "Get Token" button the application will get the access token to be used later for file managing operations.
32 |
33 | ## Upload data
34 |
35 | The upload data operation is based on the WebHDFS REST API call defined [here](http://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#Create_and_Write_to_a_File). The application must send a PUT request to the URL specified in the field "Base URL" that is shows in the following picture.
36 |
37 | 
38 |
39 | Replace "DATA LAKE STORE NAME" with the name of your Data Lake Store. The access token must be provided into the API call (see the source code for much details). The location of the file you are uploading must be provided in the resource property of the REST Request. The application can get the list of the folders contained in the Data Lake Store instance using a specific call (see ListFolders method implemented in the class TADLSFileManagerPresenter). The UploadFile method of the class TADLSFileManagerPresenter contains the code to do an upload request to Data Lake Store.
40 |
--------------------------------------------------------------------------------