Subversion Repositories XServices

Rev

Rev 198 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 198 Rev 199
Line 31... Line 31...
31
import java.util.List;
31
import java.util.List;
32
import javax.ws.rs.core.HttpHeaders;
32
import javax.ws.rs.core.HttpHeaders;
33
import javax.ws.rs.core.Response;
33
import javax.ws.rs.core.Response;
34
import javax.ws.rs.core.UriInfo;
34
import javax.ws.rs.core.UriInfo;
Line -... Line 35...
-
 
35
 
35
 
36
import lombok.extern.slf4j.Slf4j;
36
import org.apache.commons.configuration2.PropertiesConfiguration;
37
import org.apache.commons.configuration2.PropertiesConfiguration;
37
import org.apache.commons.configuration2.builder.fluent.Configurations;
38
import org.apache.commons.configuration2.builder.fluent.Configurations;
38
import org.apache.commons.configuration2.ex.ConfigurationException;
39
import org.apache.commons.configuration2.ex.ConfigurationException;
39
import org.apache.commons.jcs.JCS;
40
import org.apache.commons.jcs.JCS;
40
import org.apache.commons.jcs.access.CacheAccess;
41
import org.apache.commons.jcs.access.CacheAccess;
41
import org.apache.commons.jcs.access.exception.CacheException;
-
 
42
import org.apache.logging.log4j.LogManager;
-
 
-
 
42
import org.apache.commons.jcs.access.exception.CacheException;
Line 43... Line 43...
43
import org.apache.logging.log4j.Logger;
43
 
44
 
44
 
45
import net.brutex.xservices.cmtypes.ItemType;
45
import net.brutex.xservices.cmtypes.ItemType;
46
import net.brutex.xservices.cmtypes.ItemTypeList;
46
import net.brutex.xservices.cmtypes.ItemTypeList;
Line 76... Line 76...
76
/**
76
/**
77
 * The Class FileInfoImpl.
77
 * The Class FileInfoImpl.
78
 * 
78
 * 
79
 * @author Brian Rosenberger, bru(at)brutex.de
79
 * @author Brian Rosenberger, bru(at)brutex.de
80
 */
80
 */
-
 
81
@Slf4j
81
public class DIMCMInfoImpl implements DIMCMInfo {
82
public class DIMCMInfoImpl implements DIMCMInfo {
Line 82... Line -...
82
 
-
 
Line 83... Line 83...
83
	Logger logger = LogManager.getLogger();
83
 
84
 
84
 
85
	/*
85
	/*
86
	 * (non-Javadoc)
86
	 * (non-Javadoc)
Line 236... Line 236...
236
		if (depth <= 0)
236
		if (depth <= 0)
237
			return;
237
			return;
Line 238... Line 238...
238
 
238
 
239
		if (search == null || search.equals("")) {
239
		if (search == null || search.equals("")) {
240
			search = "*";
240
			search = "*";
241
			logger.info("No search pattern supplied, using default '*'.");
241
			log.info("No search pattern supplied, using default '*'.");
Line 242... Line 242...
242
		}
242
		}
243
 
243
 
244
		FileWalker finder = new FileWalker(search);
244
		FileWalker finder = new FileWalker(search);
245
		try {
245
		try {
246
			Files.walkFileTree(dir.toPath(),
246
			Files.walkFileTree(dir.toPath(),
247
					EnumSet.of(FileVisitOption.FOLLOW_LINKS), depth, finder);
247
					EnumSet.of(FileVisitOption.FOLLOW_LINKS), depth, finder);
248
			logger.info("FileWalker returned '" + finder.getCount()
248
			log.info("FileWalker returned '" + finder.getCount()
249
					+ "' hits. '" + finder.getTotal()
249
					+ "' hits. '" + finder.getTotal()
250
					+ "' files have been scanned.");
250
					+ "' files have been scanned.");
251
			List<Path> result = finder.getResult();
251
			List<Path> result = finder.getResult();
Line 259... Line 259...
259
						continue;
259
						continue;
260
				}
260
				}
261
				list.add(new FileInfoType(f, baseuri));
261
				list.add(new FileInfoType(f, baseuri));
262
			}
262
			}
263
		} catch (IOException e2) {
263
		} catch (IOException e2) {
264
			logger.error(e2.getMessage(), e2);
264
			log.error(e2.getMessage(), e2);
265
			;
265
			;
266
		}
266
		}
267
	}
267
	}
Line 268... Line 268...
268
 
268
 
Line 322... Line 322...
322
		try {
322
		try {
323
			conn = DimensionsConnectionManager.getThreadConnection();
323
			conn = DimensionsConnectionManager.getThreadConnection();
324
			if (conn != null)
324
			if (conn != null)
325
				return conn;
325
				return conn;
326
		} catch (Exception e) {
326
		} catch (Exception e) {
327
			logger.error(e.getMessage());
327
			log.error(e.getMessage());
328
		}
328
		}
Line 329... Line 329...
329
 
329
 
330
		/*
330
		/*
331
		 * Create a new connection from property file
331
		 * Create a new connection from property file