getLen(imgTop, imgScale),
getLen(imgLeft, imgScale), getLen(imgWidth,
imgScale), getLen(imgHeight, imgScale));
dbFileMng.restore(imgSrcPath, file);
} else if (site.getUploadFtp() != null) {
Ftp ftp = site.getUploadFtp();
String ftpUrl = ftp.getUrl();
imgSrcPath = imgSrcPath.substring(ftpUrl.length());
File file = ftp.retrieve(imgSrcPath);
imageScale.resizeFix(file, file, reMinWidth, reMinHeight,
getLen(imgTop, imgScale),
getLen(imgLeft, imgScale), getLen(imgWidth,
imgScale), getLen(imgHeight, imgScale));
ftp.restore(imgSrcPath, file);
} else {
String ctx = request.getContextPath();
imgSrcPath = imgSrcPath.substring(ctx.length());
File file = fileRepository.retrieve(imgSrcPath);
imageScale.resizeFix(file, file, reMinWidth, reMinHeight,
getLen(imgTop, imgScale),
getLen(imgLeft, imgScale), getLen(imgWidth,
imgScale), getLen(imgHeight, imgScale));
}
} else {
if (site.getConfig().getUploadToDb()) {
String dbFilePath = site.getConfig().getDbFileUri();
imgSrcPath = imgSrcPath.substring(dbFilePath.length());
File file = dbFileMng.retrieve(imgSrcPath);
imageScale.resizeFix(file, file, reMinWidth, reMinHeight);
dbFileMng.restore(imgSrcPath, file);
} else if (site.getUploadFtp() != null) {
Ftp ftp = site.getUploadFtp();
String ftpUrl = ftp.getUrl();
imgSrcPath = imgSrcPath.substring(ftpUrl.length());
File file = ftp.retrieve(imgSrcPath);
imageScale.resizeFix(file, file, reMinWidth, reMinHeight);
ftp.restore(imgSrcPath, file);
} else {
String ctx = request.getContextPath();
imgSrcPath = imgSrcPath.substring(ctx.length());
File file = fileRepository.retrieve(imgSrcPath);
imageScale.resizeFix(file, file, reMinWidth, reMinHeight);