Why isn't J2ME able to create recursive directory creation?

前端 未结 1 1631
灰色年华
灰色年华 2021-01-28 04:01

I want to create recursive directories ( for example : Connector.open(\"file:///Phone:/folder_1/folder_2/\", Connector.READ_WRITE); ). The problem is t

相关标签:
1条回答
  • you may also try thing new way. you can make your method recursive, now pass one vector & integer parameter, vector's element will be the list of directories you want to create and integer will specify the number of time method should call it self.

    i.e. for folder_1 & folder_2 you can pass parameter as method_name ( folderVector, 2 ). here folderVector variable contains two String element as folder_1 & folder_2. Now you need to call your method recursively such that , each time second parameter decrements it's value with one down. Run this method till it is greater than zero.

    This is the one way you can do it recursively.

    0 讨论(0)
提交回复
热议问题