Examples of FileService


Examples of org.jbpm.formbuilder.server.file.FileService

   
    //test response to a FileException for RESTFileService.getFile(...)
    public void testGetFileServiceProblem() throws Exception {
        RESTFileService restService = new RESTFileService();
        List<Object> requestMocks = createRequestMocks();
        FileService fileService = EasyMock.createMock(FileService.class);
        FileException exception = new FileException(new NullPointerException());
        EasyMock.expect(fileService.loadFile(EasyMock.same("somePackage"), EasyMock.same("myFile.tmp"))).
            andThrow(exception);
        requestMocks.add(fileService);
        restService.setFileService(fileService);
        Object[] mocks = requestMocks.toArray();
        EasyMock.replay(mocks);
View Full Code Here

Examples of org.jbpm.formbuilder.server.file.FileService

        assertStatus(resp.getStatus(), Status.INTERNAL_SERVER_ERROR);
    }
   
    public void testSaveFileNotMultipart() throws Exception {
        RESTFileService restService = createSaveFileMockService(null, null, null, false);
        FileService fileService = EasyMock.createMock(FileService.class);
        restService.setFileService(fileService);
        HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
        HttpSession session = EasyMock.createMock(HttpSession.class);
        EasyMock.expect(request.getSession()).andReturn(session).once();
        ServletContext context = EasyMock.createMock(ServletContext.class);
View Full Code Here

Examples of org.jbpm.formbuilder.server.file.FileService

   
    public void testSaveFileOK() throws Exception {
        byte[] bstream = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9};
        String fileName = "fileName";       
        RESTFileService restService = createSaveFileMockService(bstream, fileName, null, true);
        FileService fileService = EasyMock.createMock(FileService.class);
        String url = "http://www.redhat.com";
        EasyMock.expect(fileService.storeFile(EasyMock.eq("somePackage"), EasyMock.eq("fileName"), EasyMock.same(bstream))).
            andReturn(url).once();
        restService.setFileService(fileService);
        HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
        HttpSession session = EasyMock.createMock(HttpSession.class);
        EasyMock.expect(request.getSession()).andReturn(session).once();
View Full Code Here

Examples of org.jbpm.formbuilder.server.file.FileService

   
    public void testSaveFileServiceProblem() throws Exception {
        byte[] bstream = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9};
        String fileName = "fileName";       
        RESTFileService restService = createSaveFileMockService(bstream, fileName, null, true);
        FileService fileService = EasyMock.createMock(FileService.class);
        FileException exception = new FileException();
        EasyMock.expect(fileService.storeFile(EasyMock.eq("somePackage"), EasyMock.eq("fileName"), EasyMock.same(bstream))).
            andThrow(exception).once();
        restService.setFileService(fileService);
        HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
        HttpSession session = EasyMock.createMock(HttpSession.class);
        EasyMock.expect(request.getSession()).andReturn(session).once();
View Full Code Here

Examples of org.pentaho.platform.web.http.api.resources.services.FileService

  Map<String, Converter> converters;

  protected NameBaseMimeResolver mimeResolver;

  public FileResource() {
    fileService = new FileService();
    schedulerResource = new SchedulerResource();
  }
View Full Code Here

Examples of org.pentaho.platform.web.http.api.resources.services.FileService

  private static final Log logger = LogFactory.getLog( FileResource.class );

  public DirectoryResource() {
    super();
    fileService = new FileService();
  }
View Full Code Here

Examples of org.serviceconnector.service.FileService

    default:
      // code for other types of services is below
      break;
    }

    FileService fileService = this.validateFileService(message.getServiceName());
    if (fileService.isEnabled() == false) {
      SCMPCommandException scmpCommandException = new SCMPCommandException(SCMPError.SERVICE_DISABLED, "service="
          + fileService.getName() + " is disabled");
      scmpCommandException.setMessageType(getKey());
      throw scmpCommandException;
    }
    SCMPMessage reply = null;
    try {
      FileServer fileServer = fileService.getServer();
      reply = fileServer.serverGetFileList(fileService.getPath(), fileService.getGetFileListScriptName(),
          message.getServiceName(), oti);
    } catch (Exception e) {
      SCMPCommandException scmpCommandException = new SCMPCommandException(SCMPError.GET_FILE_LIST_FAILED,
          "Error occured in get file list on SC.");
      scmpCommandException.setMessageType(getKey());
View Full Code Here

Examples of org.serviceconnector.service.FileService

      return;
    case SESSION_SERVICE:
      // code for type session service is below switch statement
      break;
    case FILE_SERVICE:
      FileService fileService = (FileService) abstractService;
      // create file session
      FileSession fileSession = new FileSession(sessionInfo, ipAddressList, fileService.getPath(),
          fileService.getUploadFileScriptName(), fileService.getGetFileListScriptName());
      fileSession.setService(fileService);
      FileServer fileServer = fileService.allocateFileServerAndCreateSession(fileSession);
      // add server to session
      fileSession.setServer(fileServer);
      fileSession.setSessionTimeoutMillis(eciInMillis * basicConf.getEchoIntervalMultiplier());
      // finally add file session to the registry
      this.sessionRegistry.addSession(fileSession.getId(), fileSession);
View Full Code Here

Examples of org.serviceconnector.service.FileService

      return;
    case SESSION_SERVICE:
      // code for type session service is below switch statement
      break;
    case FILE_SERVICE:
      FileService fileService = (FileService) abstractService;
      // create file session
      FileSession fileSession = new FileSession(sessionInfo, ipAddressList, fileService.getPath(),
          fileService.getUploadFileScriptName(), fileService.getGetFileListScriptName());
      fileSession.setService(fileService);
      FileServer fileServer = fileService.allocateFileServerAndCreateSession(fileSession);
      // add server to session
      fileSession.setServer(fileServer);
      fileSession.setSessionTimeoutMillis(eciInMillis * basicConf.getEchoIntervalMultiplier());
      // finally add file session to the registry
      this.sessionRegistry.addSession(fileSession.getId(), fileSession);
View Full Code Here

Examples of org.serviceconnector.service.FileService

    default:
      // code for other types of services is below
      break;
    }

    FileService fileService = this.validateFileService(message.getServiceName());
    if (fileService.isEnabled() == false) {
      SCMPCommandException scmpCommandException = new SCMPCommandException(SCMPError.SERVICE_DISABLED, "service="
          + fileService.getName() + " is disabled");
      scmpCommandException.setMessageType(getKey());
      throw scmpCommandException;
    }
    SCMPMessage reply = null;
    try {
      FileServer fileServer = fileService.getServer();
      reply = fileServer.serverGetFileList(fileService.getPath(), fileService.getGetFileListScriptName(),
          message, oti);
    } catch (Exception e) {
      SCMPCommandException scmpCommandException = new SCMPCommandException(SCMPError.GET_FILE_LIST_FAILED,
          "Error occured in get file list on SC.");
      scmpCommandException.setMessageType(getKey());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.