Skip to content

Instantly share code, notes, and snippets.

Jose Manuel Prieto prietopa

Block or report user

Report or block prietopa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am prietopa on github.
  • I am prietopa (https://keybase.io/prietopa) on keybase.
  • I have a public key ASAloBYFHmb5nhcC8U2mMwzd9lKWL9mpgPLgLlbVwwLViQo

To claim this, I am signing this object:

View DownloadVideoFromInternet
package es.pp.jm.utils;
import java.io.FileOutputStream;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
public class DownloadVideoFromInternet {
// http://stackoverflow.com/questions/921262/how-to-download-and-save-a-file-from-internet-using-java
@prietopa
prietopa / ListComparator
Last active Aug 29, 2015
Compare List easy
View ListComparator
public abstract class ListComparator<B> {
/**
* Only compare elements must not change, like id.
*
* @param left
* @param right
* @return
*/
protected abstract boolean isEqualsBeans(B left, B right);
@prietopa
prietopa / AbstractClientInPersistInterceptor
Last active Aug 29, 2015
CXF persist/audit client Request/Response
View AbstractClientInPersistInterceptor
package net.pp.jm.cxf.interceptor.persist.client;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Date;
import org.apache.cxf.helpers.IOUtils;
import org.apache.cxf.interceptor.Fault;
@prietopa
prietopa / gist:688698382a958c83eb20
Last active Aug 29, 2015
crea una lista de "schemasList" y de "classesToBeBoundList" para la configuracion de Spring
View gist:688698382a958c83eb20
package net.pp.jm.spring.oxm.config.test;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import org.apache.commons.io.FileUtils;
import org.junit.Test;
public class ListDirectoryTest {
@prietopa
prietopa / addProxy(user-pass)
Created Nov 17, 2014
add proxy(user-pass) to java execution
View addProxy(user-pass)
public static void addProxy(String user, String pass, String host, String port) {
if(user!= null && pass != null) {
final String authUser = user;
final String authPassword = pass;
Authenticator.setDefault(
new Authenticator() {
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(
@prietopa
prietopa / CrudList.java
Created Jun 1, 2013
CRUD con List, implementarlo con Collection<?>
View CrudList.java
package net.josemanuel.prietopalacios.util;
import java.util.ArrayList;
import java.util.List;
public class CrudList<T> {
public List<T> create(){
return new ArrayList<T>();
}
View Utils.java
public class Utils{
public boolean isStrBlank(String str) {
if (str == null) {
return true;
} else if (str.equals("")) {
return true;
} else if (str.trim().isEmpty()) {
return true;
} else {
You can’t perform that action at this time.