This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start boot2docker | |
... | |
boot2docker ssh | |
... | |
# Open/create profile file with vi | |
sudo vi var/lib/boot2docker/profile | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET serveroutput ON; | |
BEGIN | |
FOR c IN( SELECT table_name FROM user_tables WHERE table_name NOT LIKE 'SYS%') | |
LOOP | |
EXECUTE IMMEDIATE ('DROP TABLE ' || c.table_name || ' CASCADE CONSTRAINTS'); | |
END LOOP; | |
FOR s IN (SELECT sequence_name FROM user_sequences ) | |
LOOP | |
EXECUTE IMMEDIATE ('DROP SEQUENCE ' || s.sequence_name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.persistence.EntityNotFoundException; | |
import javax.ws.rs.core.Response; | |
import javax.ws.rs.ext.ExceptionMapper; | |
import javax.ws.rs.ext.Provider; | |
@Provider | |
public class EntityNotFoundEjbExceptionMapper implements ExceptionMapper<EntityNotFoundException> { | |
@Override | |
public Response toResponse(EntityNotFoundException exception) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- drop / create user | |
drop user xdev01 CASCADE; | |
CREATE USER xdev01 IDENTIFIED BY xdev01; | |
ALTER USER xdev01 | |
DEFAULT TABLESPACE USERS | |
TEMPORARY TABLESPACE TEMP | |
ACCOUNT UNLOCK; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void removePath(Path path) throws IOException { | |
Files.walkFileTree(path, new SimpleFileVisitor<Path>() { | |
@Override | |
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { | |
Files.delete(file); | |
return FileVisitResult.CONTINUE; | |
} | |
@Override | |
public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void copyPath(Path source, Path target) throws IOException { | |
Files.walkFileTree(source, new SimpleFileVisitor<Path>() { | |
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { | |
return copy(file); | |
} | |
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { | |
return copy(dir); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On a Mac, the path is ~/Library/Caches/IntelliJIdea14/Maven/Indices/UserArchetypes.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.jboss.shrinkwrap.resolver</groupId> | |
<artifactId>shrinkwrap-resolver-depchain</artifactId> | |
<version>2.1.0</version> | |
<scope>test</scope> | |
<type>pom</type> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-assembly-plugin</artifactId> | |
<version>2.2.1</version> | |
<configuration> | |
<archive> | |
<manifest> | |
<mainClass>path.to.your.main.Class</mainClass> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Provider | |
@Path("/preferences") | |
@Api("/preferences") | |
public class PreferenceResource { | |
@Inject | |
private PreferenceController preferenceController; | |
@Context | |
private UriInfo uriInfo; |