FAQ  •  Register  •  Login

Extract json from Zip archive

<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Thu Jan 24, 2013 4:59 pm

Extract json from Zip archive

For pluzz plugin, I need to extract json information from archive :
http://webservices.francetelevisions.fr ... x_main.zip

How to extract them with groovy plugin ?
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Jan 24, 2013 6:44 pm

Re: Extract json from Zip archive

I have

  Code:
org.serviio.util.ZipUtils.unZipSingleFile(InputStream stream)


But use on your own risk as it's not a shared method and might be renamed/moved in future

Otherwise you can do it manually like this

  Code:
ZipInputStream zis = new ZipInputStream(is);
ZipEntry entry = zis.getNextEntry();
if( entry == null ) {
   throw new IOException("Invalid zip file");
}
// now read bytes from the InputStream zis
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Fri Jan 25, 2013 2:43 pm

Re: Extract json from Zip archive

This will not be easy for me.
I am not a Java developer.
This is a new challenge.
Thanks.
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Tue Jan 29, 2013 9:47 am

Re: Extract json from Zip archive

It has not been easy, but it works, I create my own method. Will be implemented in the next pluzz.groovy plugin
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator

Return to Plugin development

Who is online

Users browsing this forum: No registered users and 17 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.