Package com.sic.plugins.kpp.provider
Class KPPBaseProvider
- java.lang.Object
-
- com.sic.plugins.kpp.provider.KPPBaseProvider
-
- Direct Known Subclasses:
KPPBaseKeychainsProvider
,KPPBaseProvisioningProfilesProvider
public abstract class KPPBaseProvider extends Object
Abstract base class for providers.- Author:
- Michael Bär
-
-
Constructor Summary
Constructors Constructor Description KPPBaseProvider()
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
checkAndCreateUploadFolder()
Check if upload folder exists.XmlFile
getConfigXmlFile()
Get the provider config file.String
getConfigXmlFileName()
Get provider config xml filename.File[]
getFilesFromUploadDirectory(String fileExtension)
Get all files filtered by filetype from upload directory.String
getUploadDirectoryPath()
Get the default Upload Directory Path for Keychains and Provisioning Profiles files.protected abstract void
merge()
Merge from file.protected <T> List<T>
mergedObjects(List<T> objectsFromXml, List<T> objectsFromFolder)
Merge two lists of objects.void
save()
Save provider config xml.void
update()
Update provider from config and content of upload folder.void
upload(org.apache.commons.fileupload.FileItem fileItemToUpload)
Store uploaded file inside upload directory.
-
-
-
Field Detail
-
LOGGER
protected static final Logger LOGGER
-
-
Method Detail
-
checkAndCreateUploadFolder
protected void checkAndCreateUploadFolder()
Check if upload folder exists. If folder not exists than create the folder.
-
getUploadDirectoryPath
public String getUploadDirectoryPath()
Get the default Upload Directory Path for Keychains and Provisioning Profiles files.- Returns:
-
upload
public void upload(org.apache.commons.fileupload.FileItem fileItemToUpload) throws FileNotFoundException, IOException
Store uploaded file inside upload directory.- Throws:
FileNotFoundException
IOException
-
getConfigXmlFile
public XmlFile getConfigXmlFile()
Get the provider config file.- Returns:
-
getConfigXmlFileName
public String getConfigXmlFileName()
Get provider config xml filename.- Returns:
- filename
-
save
public final void save()
Save provider config xml.
-
update
public void update()
Update provider from config and content of upload folder. If you override this method, call super after your implementation.
-
getFilesFromUploadDirectory
public File[] getFilesFromUploadDirectory(String fileExtension)
Get all files filtered by filetype from upload directory.- Parameters:
fileExtension
- , e.g. ".keychain"- Returns:
- array with all files
-
mergedObjects
protected <T> List<T> mergedObjects(List<T> objectsFromXml, List<T> objectsFromFolder)
Merge two lists of objects.- Type Parameters:
T
- type- Parameters:
objectsFromXml
- objects loaded from xmlobjectsFromFolder
- objects loaded from upload folder- Returns:
- merged objects
-
merge
protected abstract void merge()
Merge from file.
-
-