Package org.openiam.common.beans.mq
Class FileRabbitMQService
- java.lang.Object
-
- org.openiam.common.beans.mq.AbstractRabbitMQService
-
- org.openiam.common.beans.mq.FileRabbitMQService
-
@Component public final class FileRabbitMQService extends AbstractRabbitMQService
The purpose of this class is to provide a possiblities to work with files through OpenIAM groovy extension. This is critical to use this service from Groovy because direct access to native File operaions are blocked from Groovy scripts.
-
-
Field Summary
-
Fields inherited from class org.openiam.common.beans.mq.AbstractRabbitMQService
rabbitMQSender
-
-
Constructor Summary
Constructors Constructor Description FileRabbitMQService(FileQueue fileQueue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendContentToFile(String fileName, String body)StringgetFile(String fName)get text file by Name or relative pathFilesaveFile(String fileName, String body)Save #body to text file named #fileName. if file exists this method overwrites old one-
Methods inherited from class org.openiam.common.beans.mq.AbstractRabbitMQService
crudRequest, idRequest
-
-
-
-
Constructor Detail
-
FileRabbitMQService
public FileRabbitMQService(FileQueue fileQueue)
-
-
Method Detail
-
getFile
public String getFile(String fName)
get text file by Name or relative path- Parameters:
fName- - name of file- Returns:
- - file content in
Stringcontainer
-
saveFile
public File saveFile(String fileName, String body)
Save #body to text file named #fileName. if file exists this method overwrites old one- Parameters:
fileName- - name of file to savebody- - the content of text file- Returns:
- -
Fileto created file, null - if any errors are happend
-
-