Package org.cyclos.impl.system
Class RawFileServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.system.RawFileServiceImpl
-
- All Implemented Interfaces:
RawFileServiceLocal,Service,RawFileService
@Service public class RawFileServiceImpl extends BaseServiceImpl implements RawFileServiceLocal
Implementation forRawFileService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description RawFileServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TempFilecreateTemp(String name, String contentType, SerializableInputStream content)Creates a new generic temporary filelongdeleteExpiredTemp()Deletes the expired temporary files from the database and the corresponding contents from the content storage.<T extends RawFile>
TfindAs(Class<T> clazz, Long id)Finds the given raw file subclass by idList<RawFileVO>listTemp(String guestKey, CustomFieldVO customFieldVO)Lists the temporary files owned by the current user or guest.RawFileVOload(Long id)Loads a vo by idvoidmove(TempFile temp, StoredFile file)Move the content of the given temporary file to a final destinationSerializableInputStreamreadContent(Long id)Reads the contents of the given fileprotected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidremove(Long id)Removes the given filevoidremoveAll(List<Long> ids)Removes the files with the given idsvoidsaveName(Long id, String name)Saves the name of the given fileRawFileVOsaveTemp(String guestKey, CustomFieldVO customFieldVO, String name, String contentType, SerializableInputStream content)Saves the given file content.-
Methods inherited from class org.cyclos.impl.BaseServiceImpl
initializeNetworkMappings
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, setAlreadyValidated, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
createTemp
public TempFile createTemp(String name, String contentType, SerializableInputStream content)
Description copied from interface:RawFileServiceLocalCreates a new generic temporary file- Specified by:
createTempin interfaceRawFileServiceLocal
-
deleteExpiredTemp
public long deleteExpiredTemp()
Description copied from interface:RawFileServiceLocalDeletes the expired temporary files from the database and the corresponding contents from the content storage.- Specified by:
deleteExpiredTempin interfaceRawFileServiceLocal
-
findAs
public <T extends RawFile> T findAs(Class<T> clazz, Long id)
Description copied from interface:RawFileServiceLocalFinds the given raw file subclass by id- Specified by:
findAsin interfaceRawFileServiceLocal
-
listTemp
public List<RawFileVO> listTemp(String guestKey, CustomFieldVO customFieldVO) throws FrameworkException
Description copied from interface:RawFileServiceLists the temporary files owned by the current user or guest. Guests are matched by guest key or remote address if none is given- Specified by:
listTempin interfaceRawFileService- Throws:
FrameworkException
-
load
public RawFileVO load(Long id) throws FrameworkException
Description copied from interface:RawFileServiceLoads a vo by id- Specified by:
loadin interfaceRawFileService- Throws:
FrameworkException
-
move
public void move(TempFile temp, StoredFile file)
Description copied from interface:RawFileServiceLocalMove the content of the given temporary file to a final destination- Specified by:
movein interfaceRawFileServiceLocal
-
readContent
public SerializableInputStream readContent(Long id) throws FrameworkException
Description copied from interface:RawFileServiceReads the contents of the given file- Specified by:
readContentin interfaceRawFileService- Throws:
FrameworkException
-
remove
public void remove(Long id) throws FrameworkException
Description copied from interface:RawFileServiceRemoves the given file- Specified by:
removein interfaceRawFileService- Throws:
FrameworkException
-
removeAll
public void removeAll(List<Long> ids) throws FrameworkException
Description copied from interface:RawFileServiceRemoves the files with the given ids- Specified by:
removeAllin interfaceRawFileService- Throws:
FrameworkException
-
saveName
public void saveName(Long id, String name) throws FrameworkException
Description copied from interface:RawFileServiceSaves the name of the given file- Specified by:
saveNamein interfaceRawFileService- Throws:
FrameworkException
-
saveTemp
public RawFileVO saveTemp(String guestKey, CustomFieldVO customFieldVO, String name, String contentType, SerializableInputStream content) throws FrameworkException
Description copied from interface:RawFileServiceSaves the given file content. Temporary files are used forCustomFieldType.FILEcustom field then it must be specified through thecustomFieldVOparameter and it must contains also the nature to allow load the correct custom field sub-class.- Specified by:
saveTempin interfaceRawFileService- Throws:
FrameworkException
-
registerNetworkMappings
protected void registerNetworkMappings(NetworkPathRegistry networkPathRegistry)
Description copied from class:BaseServiceImplNeeds to be overridden by subclasses to register the path up to the network- Specified by:
registerNetworkMappingsin classBaseServiceImpl
-
-