Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Create structure folders

 Post Reply Post Reply
Author
Automação.com View Drop Down
New Member
New Member
Avatar

Joined: 30 Nov 2017
Posts: 22
Post Options Post Options   Quote Automação.com Quote  Post ReplyReply Direct Link To This Post Topic: Create structure folders
    Posted: 04 Dec 2017 at 6:38pm
I"m trying to create a method where I can pass a string with a folder structure to be created from GOOGLE DRIVE.

I"m using TAdvGDRIVE = Storage object

The method would seem to be simple, I"ll send the structure as the following example:

Create Folder Structure ("\ Folder1\ subs-folder1\ test1")

The first folder is created normally but from 2a an error occurs.

Invalid class typecast

function CriarEstruturaPastas(sPasta:string):TCloudItem;

var
 slPastas : TStringList;
 z,i: integer;
 ci, ciPasta:TCloudItem;
 cisPesquisa:TCloudItems;
 achou: boolean;
begin
 try
   try
     slPastas := TStringList.Create;

     slPastas.Delimiter := "\";

     slPastas.StrictDelimiter := true;

     slPastas.DelimitedText := sPasta;

     if slPastas[0]="" then slPastas.Delete(0);

     Result :=nil;
    for z:=0 to slPastas.Count-1 do
    begin
        achou:=false;

        cisPesquisa:=Storage.SearchList(slPastas[z], True, Result);
         if (cisPesquisa<>nil) and (cisPesquisa.Count>0) then
         begin
           for i := 0 to cisPesquisa.Count-1 do
           begin
              ci:=TCloudItem( cisPesquisa.Items );
              if (ci.ItemType = ciFolder) AND
                 (ci.FileName = slPastas[z] )
              then
              begin
                 Result:= ci;
                 Achou:=True;
                 Break;
              end;
           end;
        end;

        if not achou then
              Result:=storage.CreateFolder(Result, slPastas[z]);
    end;
   except
     on E:Exception do
     begin
        Exception.RaiseOuterException( Exception.Create("[CriarEstruturaPastas]"));
     end;
   end;

 finally

 end;
end;

Back to Top
Automação.com View Drop Down
New Member
New Member
Avatar

Joined: 30 Nov 2017
Posts: 22
Post Options Post Options   Quote Automação.com Quote  Post ReplyReply Direct Link To This Post Posted: 07 Dec 2017 at 3:49pm
Any suggestion ?
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2219
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 07 Dec 2017 at 4:53pm
Hi,

We are currently investigating this issue and will report back as soon as possible.
Back to Top
Automação.com View Drop Down
New Member
New Member
Avatar

Joined: 30 Nov 2017
Posts: 22
Post Options Post Options   Quote Automação.com Quote  Post ReplyReply Direct Link To This Post Posted: 23 Mar 2018 at 9:13pm
Still investigating??????? 
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2219
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 26 Mar 2018 at 11:55am
Unfortunately due to the high workload caused by several ongoing projects we haven't been able to allocate sufficient time to investigate this issue.
As soon as time permits we'll have a look at this.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down