Skip to content

Instantly share code, notes, and snippets.

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.security.KeyStore;
import java.security.MessageDigest;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.SSLContext;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
package br.com.teste;
/*
* This code is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This code is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
@h3nrique
h3nrique / WrapperUtils.java
Last active December 13, 2015 19:48
Wrapper Class
package com.package.utils;
/*
* This code is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This code is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
@h3nrique
h3nrique / ZipApplication.java
Created December 14, 2012 03:04
Classe para fazer backup de diretórios.
package com.package.utils;
/*
* This code is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This code is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
@h3nrique
h3nrique / FtpUtils.java
Created August 3, 2012 03:15
Class to do useful things on the FTP server.
package com.package.utils;
/*
* This code is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This code is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
@h3nrique
h3nrique / Timer.java
Last active October 5, 2015 22:38
Class used to measure method time execution
package com.package.utils;
/*
* This code is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This code is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
@h3nrique
h3nrique / brazil-jquery.tablesorter.js
Created May 10, 2012 22:51
Brazilian Formats in jQuery Tablesorter plugin
// http://tablesorter.com/docs/index.html
ts.addParser({
id: "brazilCurrency",
is: function(s) {
return /^(R\$)(\ |\t)+\d*([\.\,]\d+)*/.test(s);
},
format: function(s) {
s = s.replace(/\./g,"");
s = s.replace(/\,/g,".");