Class SkinModelDAO

    • Method Detail

      • getModel

        public Map<String,​ObjectgetModel​(String modelId)
        Retrieve informations on a skin
        Parameters:
        modelId - The skin id
        Returns:
        the informations of a skin
      • getSkinsAndModels

        public Map<String,​ObjectgetSkinsAndModels​(boolean includeAbstract)
        Retrieve the list of models and skins available
        Parameters:
        includeAbstract - Should include abstract skins
        Returns:
        a map of skins and models
      • importModel

        public String importModel​(String modelName,
                                  String tmpDirPath)
                           throws IOException
        Import a model from a zip file
        Parameters:
        modelName - The name of the new model
        tmpDirPath - the tmp dir path where the zip has been uploaded
        Returns:
        The model name
        Throws:
        IOException - if something goes wrong when manipulating files
      • applyModel

        public boolean applyModel​(String skinId,
                                  String modelId)
                           throws IOException
        Apply model to the skin
        Parameters:
        skinId - The skin id
        modelId - The id of model
        Returns:
        true if the model was applyed successfully
        Throws:
        IOException - if an error occurs when manipulating files
      • applyModel

        protected boolean applyModel​(Skin skin,
                                     String modelId)
                              throws IOException
        Apply model to the skin
        Parameters:
        skin - The skin
        modelId - The id of model
        Returns:
        true if the model was applyed successfully
        Throws:
        IOException - if an error occurs when manipulating files
      • delete

        public void delete​(String modelId)
                    throws IOException
        Delete a model
        Parameters:
        modelId - The model id
        Throws:
        IOException - if an error occurs when manipulating files
      • unlinkModel

        public String unlinkModel​(String skinId,
                                  String modelId)
                           throws IOException
        Unlink the skin from its model
        Parameters:
        skinId - The id of the skin
        modelId - The id of the model
        Returns:
        An error code, or null on success
        Throws:
        IOException - If an error occurred while removing the link