-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debug Alpha: implementing iTunes TV specification
-organized imports and fixed builds for iTunes TV metadata
- Loading branch information
1 parent
b3bea37
commit 014469d
Showing
25 changed files
with
974 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...version/src/main/java/com/netflix/imfutility/itunes/metadata/tv/TvMetadataDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright (C) 2016 Netflix, Inc. | ||
* | ||
* This file is part of IMF Conversion Utility. | ||
* | ||
* IMF Conversion Utility is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* IMF Conversion Utility is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with IMF Conversion Utility. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.netflix.imfutility.itunes.metadata.tv; | ||
|
||
import com.apple.itunes.importer.tv.PackageType; | ||
import com.netflix.imfutility.itunes.metadata.MetadataDescriptor; | ||
|
||
import static com.netflix.imfutility.itunes.ITunesConversionXsdConstants.TV_METADATA_NAMESPACE; | ||
import static com.netflix.imfutility.itunes.ITunesConversionXsdConstants.TV_METADATA_PACKAGE; | ||
import static com.netflix.imfutility.itunes.ITunesConversionXsdConstants.TV_METADATA_ROOT_ELEMENT; | ||
import static com.netflix.imfutility.itunes.ITunesConversionXsdConstants.TV_METADATA_XML_SCHEME; | ||
|
||
/** | ||
* Metadata descriptor for iTunes tv specification. | ||
*/ | ||
public final class TvMetadataDescriptor implements MetadataDescriptor<PackageType> { | ||
|
||
public static final TvMetadataDescriptor INSTANCE = new TvMetadataDescriptor(); | ||
|
||
private TvMetadataDescriptor() { | ||
} | ||
|
||
@Override | ||
public Class<PackageType> getMetadataClass() { | ||
return PackageType.class; | ||
} | ||
|
||
@Override | ||
public String getMetadataSchema() { | ||
return TV_METADATA_XML_SCHEME; | ||
} | ||
|
||
@Override | ||
public String getMetadataPackage() { | ||
return TV_METADATA_PACKAGE; | ||
} | ||
|
||
@Override | ||
public String getMetadataNamespace() { | ||
return TV_METADATA_NAMESPACE; | ||
} | ||
|
||
@Override | ||
public String getMetadataRoot() { | ||
return TV_METADATA_ROOT_ELEMENT; | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
...version/src/main/java/com/netflix/imfutility/itunes/metadata/tv/TvMetadataXmlCreator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright (C) 2016 Netflix, Inc. | ||
* | ||
* This file is part of IMF Conversion Utility. | ||
* | ||
* IMF Conversion Utility is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* IMF Conversion Utility is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with IMF Conversion Utility. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.netflix.imfutility.itunes.metadata.tv; | ||
|
||
|
||
import com.apple.itunes.importer.tv.ObjectFactory; | ||
import com.apple.itunes.importer.tv.PackageType; | ||
import com.netflix.imfutility.itunes.metadata.tv.builder.TvMetadataXmlSampleBuilder; | ||
|
||
import javax.xml.bind.JAXBContext; | ||
import javax.xml.bind.JAXBElement; | ||
import javax.xml.bind.JAXBException; | ||
import javax.xml.bind.Marshaller; | ||
import java.io.File; | ||
|
||
/** | ||
* Provides functionality to generate sample metadata.xml for iTunes tv specification. | ||
*/ | ||
public final class TvMetadataXmlCreator { | ||
|
||
private TvMetadataXmlCreator() { | ||
} | ||
|
||
/** | ||
* Generates sample metadata.xml file. | ||
* | ||
* @param path a path to the output metadata.xml file | ||
*/ | ||
public static void generateSampleXml(String path) { | ||
File file = new File(path); | ||
JAXBContext jaxbContext; | ||
try { | ||
jaxbContext = JAXBContext.newInstance(TvMetadataDescriptor.INSTANCE.getMetadataClass()); | ||
Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); | ||
jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); | ||
|
||
JAXBElement<PackageType> metadataJaxb = new ObjectFactory().createPackage(TvMetadataXmlSampleBuilder.buildPackage()); | ||
jaxbMarshaller.marshal(metadataJaxb, file); | ||
} catch (JAXBException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.