Java help class for reading files:
[Java]
Import org. springframework. context. ApplicationContext;
Import org. springframework. context. support. ClassPathXmlApplicationContext;
/**
* Obtain the spring configuration file
* @ Author Administrator
*
*/
Public class ApplicationConxtXML {
Public static ApplicationContext getApplicationConxtXMLPropertise (){
String [] springConfigArray = {"applicationContext. xml "};
ApplicationContext ctx = new ClassPathXmlApplicationContext (springConfigArray );
Return ctx;
}
}
Call:
[Java]
Import org. springframework. context. ApplicationContext;
Import com. mcm. boss. domain. CopyCategoryImagesService;
Import com. mcm. boss. utils. ApplicationConxtXML;
Public class CopyCategoryImagesTsk {
Www.2cto.com
Public static void main (String... args ){
ApplicationContext cxt = ApplicationConxtXML
. GetApplicationConxtXMLPropertise ();
CopyCategoryImagesService copyCategoryImagesService = (CopyCategoryImagesService) cxt
. GetBean ("copyCategoryImagesService ");
Int areal [] = {1, 4 };
CopyCategoryImagesService. copyImages (areal );
}
}