|
ActiveMQ example source code file (FTPTestSupport.java)
The ActiveMQ FTPTestSupport.java source code/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.activemq.blob; import java.io.File; import java.util.ArrayList; import java.util.List; import javax.jms.Connection; import org.apache.activemq.EmbeddedBrokerTestSupport; import org.apache.activemq.util.IOHelper; import org.apache.ftpserver.FtpServer; import org.apache.ftpserver.FtpServerFactory; import org.apache.ftpserver.ftplet.Authority; import org.apache.ftpserver.ftplet.UserManager; import org.apache.ftpserver.listener.ListenerFactory; import org.apache.ftpserver.usermanager.PropertiesUserManagerFactory; import org.apache.ftpserver.usermanager.impl.BaseUser; import org.apache.ftpserver.usermanager.impl.WritePermission; import org.jmock.Mockery; public abstract class FTPTestSupport extends EmbeddedBrokerTestSupport { protected static final String ftpServerListenerName = "default"; protected Connection connection; protected FtpServer server; String userNamePass = "activemq"; Mockery context = null; String ftpUrl; int ftpPort; final File ftpHomeDirFile = new File("target/FTPBlobTest/ftptest"); protected void setUp() throws Exception { if (ftpHomeDirFile.getParentFile().exists()) { IOHelper.deleteFile(ftpHomeDirFile.getParentFile()); } ftpHomeDirFile.mkdirs(); ftpHomeDirFile.getParentFile().deleteOnExit(); FtpServerFactory serverFactory = new FtpServerFactory(); ListenerFactory factory = new ListenerFactory(); PropertiesUserManagerFactory userManagerFactory = new PropertiesUserManagerFactory(); UserManager userManager = userManagerFactory.createUserManager(); BaseUser user = new BaseUser(); user.setName("activemq"); user.setPassword("activemq"); user.setHomeDirectory(ftpHomeDirFile.getParent()); // authorize user List<Authority> auths = new ArrayList Other ActiveMQ examples (source code examples)Here is a short list of links related to this ActiveMQ FTPTestSupport.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.