alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Struts example source code file (FileManagerTest.java)

This example Struts source code file (FileManagerTest.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Struts tags/keywords

exception, exception, filemanagertest, filemanagertest, inputstream, io, net, network, url, url, xworktestcase, xworktestcase

The Struts FileManagerTest.java source code

package com.opensymphony.xwork2.util;

import com.opensymphony.xwork2.XWorkTestCase;

import java.io.InputStream;
import java.net.URL;

/**
 * FileManager Tester.
 *
 * @author <Lukasz>
 * @since <pre>02/18/2009
* @version 1.0 */ public class FileManagerTest extends XWorkTestCase { public void testGetFileInJar() throws Exception { testLoadFile("xwork-jar.xml"); testLoadFile("xwork - jar.xml"); testLoadFile("xwork-zip.xml"); testLoadFile("xwork - zip.xml"); testLoadFile("xwork-jar2.xml"); testLoadFile("xwork - jar2.xml"); testLoadFile("xwork-zip2.xml"); testLoadFile("xwork - zip2.xml"); } private void testLoadFile(String fileName) { FileManager.setReloadingConfigs(true); URL url = ClassLoaderUtil.getResource(fileName, FileManagerTest.class); InputStream file = FileManager.loadFile(url, true); assertNotNull(file); assertFalse(!FileManager.fileNeedsReloading(fileName)); } }

Other Struts examples (source code examples)

Here is a short list of links related to this Struts FileManagerTest.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

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.