Skip to content

Instantly share code, notes, and snippets.

View jogaco's full-sized avatar
🎯
Focusing

J. Garcia jogaco

🎯
Focusing
View GitHub Profile
class ArticleImageUploader < ImageUploader
process :fix_exif_rotation
process :strip
process :convert => 'jpg'
process :quality => 85 # Percentage from 0 - 100
version :gallery_thumb do
process :resize_to_fill => Settings.images.article_images.processing.gallery_thumb #44x44
end
@jogaco
jogaco / BasicAuthAuthorizationInterceptor.java
Last active August 28, 2017 10:44
Java REST Web Service securization for Apache CXF 2.3.3 with Spring Security 3.0.5: Basic Authentication
import javax.ws.rs.core.Response;
import org.apache.cxf.configuration.security.AuthorizationPolicy;
import org.apache.cxf.interceptor.security.AccessDeniedException;
import org.apache.cxf.jaxrs.ext.RequestHandler;
import org.apache.cxf.jaxrs.model.ClassResourceInfo;
import org.apache.cxf.message.Message;
import org.apache.log4j.Logger;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.authentication.encoding.PasswordEncoder;