0

I have created an arraylist with fileSystem using the Composite pattern. The file system has folders and files. The folder can also have folders. Using the template method, I need to create classes that convert a fileSystem object into two formats: json and xml. How do I convert a fileSystem object into json and xml?

Tim Hutchison
  • 3,483
  • 9
  • 40
  • 76
  • Component fileSystem = new Directory(" file System"); Component diskC = new Directory("disk C"); Component pngFile = new File("12345.png"); Component docxFile = new File("Document.docx"); diskC.Add(pngFile); diskC.Add(docxFile); fileSystem.Add(diskC); – Dany worner Jun 01 '17 at 12:15
  • Please add your code to the question itself rather than to the comments – Tim Hutchison Jun 01 '17 at 12:36
  • i need help how convert object who have directory in directory ... and this directory have file into json. like return { name + "{" ..... } }? help pls – Dany worner Jun 01 '17 at 12:52

0 Answers0