src/main/java/uth/bio/phosphpred/service/UploadService.java
public boolean save(UploadDTO uploadDTO) {
        log.debug("Request to save UploadDTO : {}", uploadDTO);
        try {
            FileOutputStream fos;

            if (uploadDTO.getFasta_file()!=null) {
                fos = new FileOutputStream(env.getProperty("files-directory") + "/hmmrUploads/" + uploadDTO.getId()
                    + ".fasta");
                fos.write(uploadDTO.getFasta_file());
            } else {
                fos = new FileOutputStream(env.getProperty("files-directory") + "/hmmrUploads/" + uploadDTO.getId()
                    + "_p.fasta");
                fos.write(uploadDTO.getFasta_text().getBytes(StandardCharsets.UTF_8));
            }
            fos.close();
        } catch (IOException e){
            log.error(e.getMessage());
            return false;
        }

        return true;
    }
/**
     * Save a upload.
     *
     * @param uploadDTO the entity to save
     * @return the persisted entity
     */
Save a upload.
@param uploadDTO the entity to save
@return the persisted entity
Save a upload . @param uploadDTO the entity to save @return the persisted entity
public boolean save(UploadDTO uploadDTO) {
        log.debug("Request to save UploadDTO : {}", uploadDTO);
        try {
            FileOutputStream fos;
            if (uploadDTO.getFasta_file()!=null) {
                fos = new FileOutputStream(env.getProperty("files-directory") + "/hmmrUploads/" + uploadDTO.getId()
                    + ".fasta");
                fos.write(uploadDTO.getFasta_file());
            } else {
                fos = new FileOutputStream(env.getProperty("files-directory") + "/hmmrUploads/" + uploadDTO.getId()
                    + "_p.fasta");
                fos.write(uploadDTO.getFasta_text().getBytes(StandardCharsets.UTF_8));
            }
            fos.close();
        } catch (IOException e){
            log.error(e.getMessage());
            return false;
        }
        return true;
    }
public boolean save ( UploadDTO uploadDTO ) { log . debug ( "Request to save UploadDTO : {}" , uploadDTO ) ; try { FileOutputStream fos ; if ( uploadDTO . getFasta_file ( ) != null ) { fos = new FileOutputStream ( env . getProperty ( "files-directory" ) + "/hmmrUploads/" + uploadDTO . getId ( ) + ".fasta" ) ; fos . write ( uploadDTO . getFasta_file ( ) ) ; } else { fos = new FileOutputStream ( env . getProperty ( "files-directory" ) + "/hmmrUploads/" + uploadDTO . getId ( ) + "_p.fasta" ) ; fos . write ( uploadDTO . getFasta_text ( ) . getBytes ( StandardCharsets . UTF_8 ) ) ; } fos . close ( ) ; } catch ( IOException e ) { log . error ( e . getMessage ( ) ) ; return false ; } return true ; }
Save a upload.
Save a upload .