id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
111,700
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java
JmsSessionImpl.createTemporaryDestination
private SIDestinationAddress createTemporaryDestination(Distribution destType, String prefix) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "createTemporaryDestination", new Object[] { destType, prefix }); SIDestinationAddress da...
java
private SIDestinationAddress createTemporaryDestination(Distribution destType, String prefix) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "createTemporaryDestination", new Object[] { destType, prefix }); SIDestinationAddress da...
[ "private", "SIDestinationAddress", "createTemporaryDestination", "(", "Distribution", "destType", ",", "String", "prefix", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ...
Handles the call to core connection in which the temporary destination gets created. @param name the model destination name on the core connection @param prefix The destination prefix @return the string returned from the core connection
[ "Handles", "the", "call", "to", "core", "connection", "in", "which", "the", "temporary", "destination", "gets", "created", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java#L2309-L2407
111,701
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java
JmsSessionImpl.deleteTemporaryDestination
protected void deleteTemporaryDestination(SIDestinationAddress dest) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "deleteTemporaryDestination", dest); try { getCoreConnection().deleteTemporaryDestination(dest); ...
java
protected void deleteTemporaryDestination(SIDestinationAddress dest) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "deleteTemporaryDestination", dest); try { getCoreConnection().deleteTemporaryDestination(dest); ...
[ "protected", "void", "deleteTemporaryDestination", "(", "SIDestinationAddress", "dest", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", ...
Handles the call to CoreConnection to delete a temporary destination. @param name the name of the temporary destination to be deleted.
[ "Handles", "the", "call", "to", "CoreConnection", "to", "delete", "a", "temporary", "destination", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java#L2416-L2521
111,702
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java
JmsSessionImpl.isAsync
boolean isAsync() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isAsync"); boolean isAsync = !asyncConsumers.isEmpty() && getState() == STARTED; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, t...
java
boolean isAsync() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isAsync"); boolean isAsync = !asyncConsumers.isEmpty() && getState() == STARTED; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, t...
[ "boolean", "isAsync", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"isAsync\"", ")", ";", "boolean", "isAsync", ...
Test to see if any of the consumers of this session are using async message delivery. @return true if the session is being used for async delivery
[ "Test", "to", "see", "if", "any", "of", "the", "consumers", "of", "this", "session", "are", "using", "async", "message", "delivery", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java#L2529-L2536
111,703
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java
JmsSessionImpl.checkSynchronousUsage
void checkSynchronousUsage(String methodName) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "checkSynchronousUsage", methodName); // Generate an exception if the session is in async mode, and the call // has not originate...
java
void checkSynchronousUsage(String methodName) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "checkSynchronousUsage", methodName); // Generate an exception if the session is in async mode, and the call // has not originate...
[ "void", "checkSynchronousUsage", "(", "String", "methodName", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "t...
Utility method to generate JMSExceptions if a synchronous method is called on an asynchronous session. This method should be called at the beginning of every method that should not work if the owning session is being used for asynchronous receipt. @param methodName the name of the calling method, to be inserted in the...
[ "Utility", "method", "to", "generate", "JMSExceptions", "if", "a", "synchronous", "method", "is", "called", "on", "an", "asynchronous", "session", ".", "This", "method", "should", "be", "called", "at", "the", "beginning", "of", "every", "method", "that", "shou...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java#L2546-L2560
111,704
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java
JmsSessionImpl.validateStopCloseForMessageListener
void validateStopCloseForMessageListener(String functionCall) throws IllegalStateException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "validateStopForMessageListener"); //Before triggering onMessage .. SIB pushes "owning session object" to Threa...
java
void validateStopCloseForMessageListener(String functionCall) throws IllegalStateException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "validateStopForMessageListener"); //Before triggering onMessage .. SIB pushes "owning session object" to Threa...
[ "void", "validateStopCloseForMessageListener", "(", "String", "functionCall", ")", "throws", "IllegalStateException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "...
A message listener must not attempt to stop its own connection or context as this would lead to deadlock. IllegalStateException has to be thrown in case if it calls stop. THIS FUNCTION is called only in non-managed environments.
[ "A", "message", "listener", "must", "not", "attempt", "to", "stop", "its", "own", "connection", "or", "context", "as", "this", "would", "lead", "to", "deadlock", ".", "IllegalStateException", "has", "to", "be", "thrown", "in", "case", "if", "it", "calls", ...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java#L2808-L2844
111,705
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java
JmsSessionImpl.addtoAsysncSendQueue
void addtoAsysncSendQueue(JmsMsgProducerImpl msgProducer, CompletionListener cListner, Message msg, int sendMethodType, Object[] params) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "addtoAsysncSendQueue", new Object[] { msgProducer, cListner, cListner, se...
java
void addtoAsysncSendQueue(JmsMsgProducerImpl msgProducer, CompletionListener cListner, Message msg, int sendMethodType, Object[] params) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "addtoAsysncSendQueue", new Object[] { msgProducer, cListner, cListner, se...
[ "void", "addtoAsysncSendQueue", "(", "JmsMsgProducerImpl", "msgProducer", ",", "CompletionListener", "cListner", ",", "Message", "msg", ",", "int", "sendMethodType", ",", "Object", "[", "]", "params", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled"...
Adds AsynSend operation details to the Queue. This function would get called only in case of non-managed environements. @param msgProducer MessageProdcuder object which triggered AsyncSend @param cListner CompletionListener of AsyncSend @param msg
[ "Adds", "AsynSend", "operation", "details", "to", "the", "Queue", ".", "This", "function", "would", "get", "called", "only", "in", "case", "of", "non", "-", "managed", "environements", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java#L2925-L2963
111,706
OpenLiberty/open-liberty
dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/schema/ObjectClassDefinitionSpecification.java
ObjectClassDefinitionSpecification.getADs
private AttributeDefinitionSpecification[] getADs(boolean isRequired) { AttributeDefinitionSpecification[] retVal = null; Vector<AttributeDefinitionSpecification> vector = new Vector<AttributeDefinitionSpecification>(); for (Map.Entry<String, AttributeDefinitionSpecification> entry : attributes....
java
private AttributeDefinitionSpecification[] getADs(boolean isRequired) { AttributeDefinitionSpecification[] retVal = null; Vector<AttributeDefinitionSpecification> vector = new Vector<AttributeDefinitionSpecification>(); for (Map.Entry<String, AttributeDefinitionSpecification> entry : attributes....
[ "private", "AttributeDefinitionSpecification", "[", "]", "getADs", "(", "boolean", "isRequired", ")", "{", "AttributeDefinitionSpecification", "[", "]", "retVal", "=", "null", ";", "Vector", "<", "AttributeDefinitionSpecification", ">", "vector", "=", "new", "Vector",...
Helper method to filter between required and optional ADs @param isRequired @return
[ "Helper", "method", "to", "filter", "between", "required", "and", "optional", "ADs" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/schema/ObjectClassDefinitionSpecification.java#L134-L146
111,707
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaNonTransactionalDispatcher.java
SibRaNonTransactionalDispatcher.cleanup
protected void cleanup() { final String methodName = "cleanup"; if (TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, methodName); } if (_unsuccessfulMessages.size() > 0) { try { // 250710: Fix to workaround the problem where failed messages a...
java
protected void cleanup() { final String methodName = "cleanup"; if (TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, methodName); } if (_unsuccessfulMessages.size() > 0) { try { // 250710: Fix to workaround the problem where failed messages a...
[ "protected", "void", "cleanup", "(", ")", "{", "final", "String", "methodName", "=", "\"cleanup\"", ";", "if", "(", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "this", ",", "TRACE", ",", "methodName", ")", ";", "}", ...
Invoked after all messages in the batch have been delivered. Unlocks any unsuccessful messages.
[ "Invoked", "after", "all", "messages", "in", "the", "batch", "have", "been", "delivered", ".", "Unlocks", "any", "unsuccessful", "messages", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaNonTransactionalDispatcher.java#L207-L260
111,708
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/ViewHandlerImpl.java
ViewHandlerImpl.calculateLocale
@Override public Locale calculateLocale(FacesContext facesContext) { Application application = facesContext.getApplication(); for (Iterator<Locale> requestLocales = facesContext.getExternalContext().getRequestLocales(); requestLocales .hasNext();) { Locale req...
java
@Override public Locale calculateLocale(FacesContext facesContext) { Application application = facesContext.getApplication(); for (Iterator<Locale> requestLocales = facesContext.getExternalContext().getRequestLocales(); requestLocales .hasNext();) { Locale req...
[ "@", "Override", "public", "Locale", "calculateLocale", "(", "FacesContext", "facesContext", ")", "{", "Application", "application", "=", "facesContext", ".", "getApplication", "(", ")", ";", "for", "(", "Iterator", "<", "Locale", ">", "requestLocales", "=", "fa...
Get the locales specified as acceptable by the original request, compare them to the locales supported by this Application and return the best match.
[ "Get", "the", "locales", "specified", "as", "acceptable", "by", "the", "original", "request", "compare", "them", "to", "the", "locales", "supported", "by", "this", "Application", "and", "return", "the", "best", "match", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/ViewHandlerImpl.java#L199-L226
111,709
OpenLiberty/open-liberty
dev/com.ibm.ws.rest.handler.validator/src/com/ibm/ws/rest/handler/validator/internal/ValidatorRESTHandler.java
ValidatorRESTHandler.toJSONObjectForThrowable
@SuppressWarnings("unchecked") @Trivial private JSONObject toJSONObjectForThrowable(Map<String, ?> errorInfo, Throwable error) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(this, tc, "toJSONObjectForThrowable", errorInfo, error); LinkedHashMap<String, L...
java
@SuppressWarnings("unchecked") @Trivial private JSONObject toJSONObjectForThrowable(Map<String, ?> errorInfo, Throwable error) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(this, tc, "toJSONObjectForThrowable", errorInfo, error); LinkedHashMap<String, L...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Trivial", "private", "JSONObject", "toJSONObjectForThrowable", "(", "Map", "<", "String", ",", "?", ">", "errorInfo", ",", "Throwable", "error", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEn...
Populate JSON object for a top level exception or error. @param errorInfo additional information to append to exceptions and causes @param error the top level exception or error. @return JSON object representing the Throwable.
[ "Populate", "JSON", "object", "for", "a", "top", "level", "exception", "or", "error", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.rest.handler.validator/src/com/ibm/ws/rest/handler/validator/internal/ValidatorRESTHandler.java#L296-L340
111,710
database-rider/database-rider
rider-core/src/main/java/com/github/database/rider/core/api/dataset/ScriptableTable.java
ScriptableTable.getScriptEngine
private ScriptEngine getScriptEngine(String value) { String engineName = value.substring(0, value.indexOf(":")); if (engines.containsKey(engineName)) { return engines.get(engineName); } else { ScriptEngine engine = manager.getEngineByName(engineName); if (engi...
java
private ScriptEngine getScriptEngine(String value) { String engineName = value.substring(0, value.indexOf(":")); if (engines.containsKey(engineName)) { return engines.get(engineName); } else { ScriptEngine engine = manager.getEngineByName(engineName); if (engi...
[ "private", "ScriptEngine", "getScriptEngine", "(", "String", "value", ")", "{", "String", "engineName", "=", "value", ".", "substring", "(", "0", ",", "value", ".", "indexOf", "(", "\":\"", ")", ")", ";", "if", "(", "engines", ".", "containsKey", "(", "e...
Parses table cell to get script engine @param value the table cell @return scriptEngine
[ "Parses", "table", "cell", "to", "get", "script", "engine" ]
7545cc31118df9cfef3f89e27223b433a24fb5dd
https://github.com/database-rider/database-rider/blob/7545cc31118df9cfef3f89e27223b433a24fb5dd/rider-core/src/main/java/com/github/database/rider/core/api/dataset/ScriptableTable.java#L74-L87
111,711
database-rider/database-rider
rider-core/src/main/java/com/github/database/rider/core/api/dataset/ScriptableTable.java
ScriptableTable.getScriptResult
private Object getScriptResult(String script, ScriptEngine engine) throws ScriptException { String scriptToExecute = script.substring(script.indexOf(":") + 1); return engine.eval(scriptToExecute); }
java
private Object getScriptResult(String script, ScriptEngine engine) throws ScriptException { String scriptToExecute = script.substring(script.indexOf(":") + 1); return engine.eval(scriptToExecute); }
[ "private", "Object", "getScriptResult", "(", "String", "script", ",", "ScriptEngine", "engine", ")", "throws", "ScriptException", "{", "String", "scriptToExecute", "=", "script", ".", "substring", "(", "script", ".", "indexOf", "(", "\":\"", ")", "+", "1", ")"...
Evaluates the script expression @return script expression result
[ "Evaluates", "the", "script", "expression" ]
7545cc31118df9cfef3f89e27223b433a24fb5dd
https://github.com/database-rider/database-rider/blob/7545cc31118df9cfef3f89e27223b433a24fb5dd/rider-core/src/main/java/com/github/database/rider/core/api/dataset/ScriptableTable.java#L94-L97
111,712
database-rider/database-rider
rider-cdi/src/main/java/com/github/database/rider/cdi/DataSetProcessor.java
DataSetProcessor.createConnection
private Connection createConnection() { try { EntityTransaction tx = this.em.getTransaction(); if (isHibernatePresentOnClasspath() && em.getDelegate() instanceof Session) { connection = ((SessionImpl) em.unwrap(Session.class)).connection(); } else { ...
java
private Connection createConnection() { try { EntityTransaction tx = this.em.getTransaction(); if (isHibernatePresentOnClasspath() && em.getDelegate() instanceof Session) { connection = ((SessionImpl) em.unwrap(Session.class)).connection(); } else { ...
[ "private", "Connection", "createConnection", "(", ")", "{", "try", "{", "EntityTransaction", "tx", "=", "this", ".", "em", ".", "getTransaction", "(", ")", ";", "if", "(", "isHibernatePresentOnClasspath", "(", ")", "&&", "em", ".", "getDelegate", "(", ")", ...
unfortunately there is no standard way to get jdbc connection from JPA entity manager @return JDBC connection
[ "unfortunately", "there", "is", "no", "standard", "way", "to", "get", "jdbc", "connection", "from", "JPA", "entity", "manager" ]
7545cc31118df9cfef3f89e27223b433a24fb5dd
https://github.com/database-rider/database-rider/blob/7545cc31118df9cfef3f89e27223b433a24fb5dd/rider-cdi/src/main/java/com/github/database/rider/cdi/DataSetProcessor.java#L59-L77
111,713
database-rider/database-rider
rider-core/src/main/java/com/github/database/rider/core/assertion/DataSetAssert.java
DataSetAssert.compareData
@Override protected void compareData(ITable expectedTable, ITable actualTable, ComparisonColumn[] comparisonCols, FailureHandler failureHandler) throws DataSetException { logger.debug("compareData(expectedTable={}, actualTable={}, " + "comparisonCols={}, failureHandler={}) - start", ...
java
@Override protected void compareData(ITable expectedTable, ITable actualTable, ComparisonColumn[] comparisonCols, FailureHandler failureHandler) throws DataSetException { logger.debug("compareData(expectedTable={}, actualTable={}, " + "comparisonCols={}, failureHandler={}) - start", ...
[ "@", "Override", "protected", "void", "compareData", "(", "ITable", "expectedTable", ",", "ITable", "actualTable", ",", "ComparisonColumn", "[", "]", "comparisonCols", ",", "FailureHandler", "failureHandler", ")", "throws", "DataSetException", "{", "logger", ".", "d...
Same as DBUnitAssert with support for regex in row values @param expectedTable expected table @param actualTable current table @param comparisonCols columnName @param failureHandler handler @throws DataSetException if datasets does not match
[ "Same", "as", "DBUnitAssert", "with", "support", "for", "regex", "in", "row", "values" ]
7545cc31118df9cfef3f89e27223b433a24fb5dd
https://github.com/database-rider/database-rider/blob/7545cc31118df9cfef3f89e27223b433a24fb5dd/rider-core/src/main/java/com/github/database/rider/core/assertion/DataSetAssert.java#L30-L98
111,714
database-rider/database-rider
rider-core/src/main/java/com/github/database/rider/core/util/EntityManagerProvider.java
EntityManagerProvider.instance
public static synchronized EntityManagerProvider instance(String unitName, Map<String,String> overridingPersistenceProps) { overridingProperties = overridingPersistenceProps; return instance(unitName); }
java
public static synchronized EntityManagerProvider instance(String unitName, Map<String,String> overridingPersistenceProps) { overridingProperties = overridingPersistenceProps; return instance(unitName); }
[ "public", "static", "synchronized", "EntityManagerProvider", "instance", "(", "String", "unitName", ",", "Map", "<", "String", ",", "String", ">", "overridingPersistenceProps", ")", "{", "overridingProperties", "=", "overridingPersistenceProps", ";", "return", "instance...
Allows to pass in overriding Properties that may be specific to the JPA Vendor. @param unitName unit name @param overridingPersistenceProps properties to override persistence.xml props or define additions to them @return EntityManagerProvider instance
[ "Allows", "to", "pass", "in", "overriding", "Properties", "that", "may", "be", "specific", "to", "the", "JPA", "Vendor", "." ]
7545cc31118df9cfef3f89e27223b433a24fb5dd
https://github.com/database-rider/database-rider/blob/7545cc31118df9cfef3f89e27223b433a24fb5dd/rider-core/src/main/java/com/github/database/rider/core/util/EntityManagerProvider.java#L70-L73
111,715
graphhopper/map-matching
hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java
ViterbiAlgorithm.startWithInitialStateProbabilities
public void startWithInitialStateProbabilities(Collection<S> initialStates, Map<S, Double> initialLogProbabilities) { initializeStateProbabilities(null, initialStates, initialLogProbabilities); }
java
public void startWithInitialStateProbabilities(Collection<S> initialStates, Map<S, Double> initialLogProbabilities) { initializeStateProbabilities(null, initialStates, initialLogProbabilities); }
[ "public", "void", "startWithInitialStateProbabilities", "(", "Collection", "<", "S", ">", "initialStates", ",", "Map", "<", "S", ",", "Double", ">", "initialLogProbabilities", ")", "{", "initializeStateProbabilities", "(", "null", ",", "initialStates", ",", "initial...
Lets the HMM computation start with the given initial state probabilities. @param initialStates Pass a collection with predictable iteration order such as {@link ArrayList} to ensure deterministic results. @param initialLogProbabilities Initial log probabilities for each initial state. @throws NullPointerException if...
[ "Lets", "the", "HMM", "computation", "start", "with", "the", "given", "initial", "state", "probabilities", "." ]
32cd83f14cb990c2be83c8781f22dfb59e0dbeb4
https://github.com/graphhopper/map-matching/blob/32cd83f14cb990c2be83c8781f22dfb59e0dbeb4/hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java#L158-L161
111,716
graphhopper/map-matching
hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java
ViterbiAlgorithm.startWithInitialObservation
public void startWithInitialObservation(O observation, Collection<S> candidates, Map<S, Double> emissionLogProbabilities) { initializeStateProbabilities(observation, candidates, emissionLogProbabilities); }
java
public void startWithInitialObservation(O observation, Collection<S> candidates, Map<S, Double> emissionLogProbabilities) { initializeStateProbabilities(observation, candidates, emissionLogProbabilities); }
[ "public", "void", "startWithInitialObservation", "(", "O", "observation", ",", "Collection", "<", "S", ">", "candidates", ",", "Map", "<", "S", ",", "Double", ">", "emissionLogProbabilities", ")", "{", "initializeStateProbabilities", "(", "observation", ",", "cand...
Lets the HMM computation start at the given first observation and uses the given emission probabilities as the initial state probability for each starting state s. @param candidates Pass a collection with predictable iteration order such as {@link ArrayList} to ensure deterministic results. @param emissionLogProbabili...
[ "Lets", "the", "HMM", "computation", "start", "at", "the", "given", "first", "observation", "and", "uses", "the", "given", "emission", "probabilities", "as", "the", "initial", "state", "probability", "for", "each", "starting", "state", "s", "." ]
32cd83f14cb990c2be83c8781f22dfb59e0dbeb4
https://github.com/graphhopper/map-matching/blob/32cd83f14cb990c2be83c8781f22dfb59e0dbeb4/hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java#L177-L180
111,717
graphhopper/map-matching
hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java
ViterbiAlgorithm.nextStep
public void nextStep(O observation, Collection<S> candidates, Map<S, Double> emissionLogProbabilities, Map<Transition<S>, Double> transitionLogProbabilities, Map<Transition<S>, D> transitionDescriptors) { if (message == null) { throw new IllegalStateException( ...
java
public void nextStep(O observation, Collection<S> candidates, Map<S, Double> emissionLogProbabilities, Map<Transition<S>, Double> transitionLogProbabilities, Map<Transition<S>, D> transitionDescriptors) { if (message == null) { throw new IllegalStateException( ...
[ "public", "void", "nextStep", "(", "O", "observation", ",", "Collection", "<", "S", ">", "candidates", ",", "Map", "<", "S", ",", "Double", ">", "emissionLogProbabilities", ",", "Map", "<", "Transition", "<", "S", ">", ",", "Double", ">", "transitionLogPro...
Processes the next time step. Must not be called if the HMM is broken. @param candidates Pass a collection with predictable iteration order such as {@link ArrayList} to ensure deterministic results. @param emissionLogProbabilities Emission log probabilities for each candidate state. @param transitionLogProbabilities ...
[ "Processes", "the", "next", "time", "step", ".", "Must", "not", "be", "called", "if", "the", "HMM", "is", "broken", "." ]
32cd83f14cb990c2be83c8781f22dfb59e0dbeb4
https://github.com/graphhopper/map-matching/blob/32cd83f14cb990c2be83c8781f22dfb59e0dbeb4/hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java#L201-L227
111,718
graphhopper/map-matching
hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java
ViterbiAlgorithm.hmmBreak
private boolean hmmBreak(Map<S, Double> message) { for (double logProbability : message.values()) { if (logProbability != Double.NEGATIVE_INFINITY) { return false; } } return true; }
java
private boolean hmmBreak(Map<S, Double> message) { for (double logProbability : message.values()) { if (logProbability != Double.NEGATIVE_INFINITY) { return false; } } return true; }
[ "private", "boolean", "hmmBreak", "(", "Map", "<", "S", ",", "Double", ">", "message", ")", "{", "for", "(", "double", "logProbability", ":", "message", ".", "values", "(", ")", ")", "{", "if", "(", "logProbability", "!=", "Double", ".", "NEGATIVE_INFINI...
Returns whether the specified message is either empty or only contains state candidates with zero probability and thus causes the HMM to break.
[ "Returns", "whether", "the", "specified", "message", "is", "either", "empty", "or", "only", "contains", "state", "candidates", "with", "zero", "probability", "and", "thus", "causes", "the", "HMM", "to", "break", "." ]
32cd83f14cb990c2be83c8781f22dfb59e0dbeb4
https://github.com/graphhopper/map-matching/blob/32cd83f14cb990c2be83c8781f22dfb59e0dbeb4/hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java#L298-L305
111,719
graphhopper/map-matching
hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java
ViterbiAlgorithm.forwardStep
private ForwardStepResult<S, O, D> forwardStep(O observation, Collection<S> prevCandidates, Collection<S> curCandidates, Map<S, Double> message, Map<S, Double> emissionLogProbabilities, Map<Transition<S>, Double> transitionLogProbabilities, Map<Transition<S>,D> transition...
java
private ForwardStepResult<S, O, D> forwardStep(O observation, Collection<S> prevCandidates, Collection<S> curCandidates, Map<S, Double> message, Map<S, Double> emissionLogProbabilities, Map<Transition<S>, Double> transitionLogProbabilities, Map<Transition<S>,D> transition...
[ "private", "ForwardStepResult", "<", "S", ",", "O", ",", "D", ">", "forwardStep", "(", "O", "observation", ",", "Collection", "<", "S", ">", "prevCandidates", ",", "Collection", "<", "S", ">", "curCandidates", ",", "Map", "<", "S", ",", "Double", ">", ...
Computes the new forward message and the back pointers to the previous states. @throws NullPointerException if any emission probability is missing
[ "Computes", "the", "new", "forward", "message", "and", "the", "back", "pointers", "to", "the", "previous", "states", "." ]
32cd83f14cb990c2be83c8781f22dfb59e0dbeb4
https://github.com/graphhopper/map-matching/blob/32cd83f14cb990c2be83c8781f22dfb59e0dbeb4/hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java#L350-L385
111,720
graphhopper/map-matching
hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java
ViterbiAlgorithm.mostLikelyState
private S mostLikelyState() { // Otherwise an HMM break would have occurred and message would be null. assert !message.isEmpty(); S result = null; double maxLogProbability = Double.NEGATIVE_INFINITY; for (Map.Entry<S, Double> entry : message.entrySet()) { if (entry.g...
java
private S mostLikelyState() { // Otherwise an HMM break would have occurred and message would be null. assert !message.isEmpty(); S result = null; double maxLogProbability = Double.NEGATIVE_INFINITY; for (Map.Entry<S, Double> entry : message.entrySet()) { if (entry.g...
[ "private", "S", "mostLikelyState", "(", ")", "{", "// Otherwise an HMM break would have occurred and message would be null.", "assert", "!", "message", ".", "isEmpty", "(", ")", ";", "S", "result", "=", "null", ";", "double", "maxLogProbability", "=", "Double", ".", ...
Retrieves the first state of the current forward message with maximum probability.
[ "Retrieves", "the", "first", "state", "of", "the", "current", "forward", "message", "with", "maximum", "probability", "." ]
32cd83f14cb990c2be83c8781f22dfb59e0dbeb4
https://github.com/graphhopper/map-matching/blob/32cd83f14cb990c2be83c8781f22dfb59e0dbeb4/hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java#L401-L416
111,721
graphhopper/map-matching
hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java
ViterbiAlgorithm.retrieveMostLikelySequence
private List<SequenceState<S, O, D>> retrieveMostLikelySequence() { // Otherwise an HMM break would have occurred and message would be null. assert !message.isEmpty(); final S lastState = mostLikelyState(); // Retrieve most likely state sequence in reverse order final List<Sequ...
java
private List<SequenceState<S, O, D>> retrieveMostLikelySequence() { // Otherwise an HMM break would have occurred and message would be null. assert !message.isEmpty(); final S lastState = mostLikelyState(); // Retrieve most likely state sequence in reverse order final List<Sequ...
[ "private", "List", "<", "SequenceState", "<", "S", ",", "O", ",", "D", ">", ">", "retrieveMostLikelySequence", "(", ")", "{", "// Otherwise an HMM break would have occurred and message would be null.", "assert", "!", "message", ".", "isEmpty", "(", ")", ";", "final"...
Retrieves most likely sequence from the internal back pointer sequence.
[ "Retrieves", "most", "likely", "sequence", "from", "the", "internal", "back", "pointer", "sequence", "." ]
32cd83f14cb990c2be83c8781f22dfb59e0dbeb4
https://github.com/graphhopper/map-matching/blob/32cd83f14cb990c2be83c8781f22dfb59e0dbeb4/hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java#L421-L439
111,722
graphhopper/map-matching
matching-core/src/main/java/com/graphhopper/matching/MapMatching.java
MapMatching.computeViterbiSequence
private List<SequenceState<State, Observation, Path>> computeViterbiSequence( List<TimeStep<State, Observation, Path>> timeSteps, int originalGpxEntriesCount, QueryGraph queryGraph) { final HmmProbabilities probabilities = new HmmProbabilities(measurementErrorSigma, trans...
java
private List<SequenceState<State, Observation, Path>> computeViterbiSequence( List<TimeStep<State, Observation, Path>> timeSteps, int originalGpxEntriesCount, QueryGraph queryGraph) { final HmmProbabilities probabilities = new HmmProbabilities(measurementErrorSigma, trans...
[ "private", "List", "<", "SequenceState", "<", "State", ",", "Observation", ",", "Path", ">", ">", "computeViterbiSequence", "(", "List", "<", "TimeStep", "<", "State", ",", "Observation", ",", "Path", ">", ">", "timeSteps", ",", "int", "originalGpxEntriesCount...
Computes the most likely candidate sequence for the GPX entries.
[ "Computes", "the", "most", "likely", "candidate", "sequence", "for", "the", "GPX", "entries", "." ]
32cd83f14cb990c2be83c8781f22dfb59e0dbeb4
https://github.com/graphhopper/map-matching/blob/32cd83f14cb990c2be83c8781f22dfb59e0dbeb4/matching-core/src/main/java/com/graphhopper/matching/MapMatching.java#L362-L412
111,723
graphhopper/map-matching
matching-core/src/main/java/com/graphhopper/matching/MapMatching.java
MapMatching.createVirtualEdgesMap
private Map<String, EdgeIteratorState> createVirtualEdgesMap( List<Collection<QueryResult>> queriesPerEntry, EdgeExplorer explorer) { // TODO For map key, use the traversal key instead of string! Map<String, EdgeIteratorState> virtualEdgesMap = new HashMap<>(); for (Collection<QueryR...
java
private Map<String, EdgeIteratorState> createVirtualEdgesMap( List<Collection<QueryResult>> queriesPerEntry, EdgeExplorer explorer) { // TODO For map key, use the traversal key instead of string! Map<String, EdgeIteratorState> virtualEdgesMap = new HashMap<>(); for (Collection<QueryR...
[ "private", "Map", "<", "String", ",", "EdgeIteratorState", ">", "createVirtualEdgesMap", "(", "List", "<", "Collection", "<", "QueryResult", ">", ">", "queriesPerEntry", ",", "EdgeExplorer", "explorer", ")", "{", "// TODO For map key, use the traversal key instead of stri...
Returns a map where every virtual edge maps to its real edge with correct orientation.
[ "Returns", "a", "map", "where", "every", "virtual", "edge", "maps", "to", "its", "real", "edge", "with", "correct", "orientation", "." ]
32cd83f14cb990c2be83c8781f22dfb59e0dbeb4
https://github.com/graphhopper/map-matching/blob/32cd83f14cb990c2be83c8781f22dfb59e0dbeb4/matching-core/src/main/java/com/graphhopper/matching/MapMatching.java#L640-L668
111,724
graphhopper/map-matching
matching-core/src/main/java/com/graphhopper/matching/util/HmmProbabilities.java
HmmProbabilities.transitionLogProbability
public double transitionLogProbability(double routeLength, double linearDistance) { // Transition metric taken from Newson & Krumm. Double transitionMetric = Math.abs(linearDistance - routeLength); return Distributions.logExponentialDistribution(beta, transitionMetric); }
java
public double transitionLogProbability(double routeLength, double linearDistance) { // Transition metric taken from Newson & Krumm. Double transitionMetric = Math.abs(linearDistance - routeLength); return Distributions.logExponentialDistribution(beta, transitionMetric); }
[ "public", "double", "transitionLogProbability", "(", "double", "routeLength", ",", "double", "linearDistance", ")", "{", "// Transition metric taken from Newson & Krumm.", "Double", "transitionMetric", "=", "Math", ".", "abs", "(", "linearDistance", "-", "routeLength", ")...
Returns the logarithmic transition probability density for the given transition parameters. @param routeLength Length of the shortest route [m] between two consecutive map matching candidates. @param linearDistance Linear distance [m] between two consecutive GPS measurements.
[ "Returns", "the", "logarithmic", "transition", "probability", "density", "for", "the", "given", "transition", "parameters", "." ]
32cd83f14cb990c2be83c8781f22dfb59e0dbeb4
https://github.com/graphhopper/map-matching/blob/32cd83f14cb990c2be83c8781f22dfb59e0dbeb4/matching-core/src/main/java/com/graphhopper/matching/util/HmmProbabilities.java#L59-L64
111,725
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/AbstractWatchService.java
AbstractWatchService.register
public Key register(Watchable watchable, Iterable<? extends WatchEvent.Kind<?>> eventTypes) throws IOException { checkOpen(); return new Key(this, watchable, eventTypes); }
java
public Key register(Watchable watchable, Iterable<? extends WatchEvent.Kind<?>> eventTypes) throws IOException { checkOpen(); return new Key(this, watchable, eventTypes); }
[ "public", "Key", "register", "(", "Watchable", "watchable", ",", "Iterable", "<", "?", "extends", "WatchEvent", ".", "Kind", "<", "?", ">", ">", "eventTypes", ")", "throws", "IOException", "{", "checkOpen", "(", ")", ";", "return", "new", "Key", "(", "th...
Registers the given watchable with this service, returning a new watch key for it. This implementation just checks that the service is open and creates a key; subclasses may override it to do other things as well.
[ "Registers", "the", "given", "watchable", "with", "this", "service", "returning", "a", "new", "watch", "key", "for", "it", ".", "This", "implementation", "just", "checks", "that", "the", "service", "is", "open", "and", "creates", "a", "key", ";", "subclasses...
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/AbstractWatchService.java#L66-L70
111,726
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileTree.java
FileTree.lookUp
public DirectoryEntry lookUp( File workingDirectory, JimfsPath path, Set<? super LinkOption> options) throws IOException { checkNotNull(path); checkNotNull(options); DirectoryEntry result = lookUp(workingDirectory, path, options, 0); if (result == null) { // an intermediate file in the path...
java
public DirectoryEntry lookUp( File workingDirectory, JimfsPath path, Set<? super LinkOption> options) throws IOException { checkNotNull(path); checkNotNull(options); DirectoryEntry result = lookUp(workingDirectory, path, options, 0); if (result == null) { // an intermediate file in the path...
[ "public", "DirectoryEntry", "lookUp", "(", "File", "workingDirectory", ",", "JimfsPath", "path", ",", "Set", "<", "?", "super", "LinkOption", ">", "options", ")", "throws", "IOException", "{", "checkNotNull", "(", "path", ")", ";", "checkNotNull", "(", "option...
Returns the result of the file lookup for the given path.
[ "Returns", "the", "result", "of", "the", "file", "lookup", "for", "the", "given", "path", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileTree.java#L73-L84
111,727
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileTree.java
FileTree.lookUp
@Nullable private DirectoryEntry lookUp( File dir, Iterable<Name> names, Set<? super LinkOption> options, int linkDepth) throws IOException { Iterator<Name> nameIterator = names.iterator(); Name name = nameIterator.next(); while (nameIterator.hasNext()) { Directory directory = toDirector...
java
@Nullable private DirectoryEntry lookUp( File dir, Iterable<Name> names, Set<? super LinkOption> options, int linkDepth) throws IOException { Iterator<Name> nameIterator = names.iterator(); Name name = nameIterator.next(); while (nameIterator.hasNext()) { Directory directory = toDirector...
[ "@", "Nullable", "private", "DirectoryEntry", "lookUp", "(", "File", "dir", ",", "Iterable", "<", "Name", ">", "names", ",", "Set", "<", "?", "super", "LinkOption", ">", "options", ",", "int", "linkDepth", ")", "throws", "IOException", "{", "Iterator", "<"...
Looks up the given names against the given base file. If the file is not a directory, the lookup fails.
[ "Looks", "up", "the", "given", "names", "against", "the", "given", "base", "file", ".", "If", "the", "file", "is", "not", "a", "directory", "the", "lookup", "fails", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileTree.java#L117-L151
111,728
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileTree.java
FileTree.followSymbolicLink
@Nullable private DirectoryEntry followSymbolicLink(File dir, SymbolicLink link, int linkDepth) throws IOException { if (linkDepth >= MAX_SYMBOLIC_LINK_DEPTH) { throw new IOException("too many levels of symbolic links"); } return lookUp(dir, link.target(), Options.FOLLOW_LINKS, linkDepth + 1)...
java
@Nullable private DirectoryEntry followSymbolicLink(File dir, SymbolicLink link, int linkDepth) throws IOException { if (linkDepth >= MAX_SYMBOLIC_LINK_DEPTH) { throw new IOException("too many levels of symbolic links"); } return lookUp(dir, link.target(), Options.FOLLOW_LINKS, linkDepth + 1)...
[ "@", "Nullable", "private", "DirectoryEntry", "followSymbolicLink", "(", "File", "dir", ",", "SymbolicLink", "link", ",", "int", "linkDepth", ")", "throws", "IOException", "{", "if", "(", "linkDepth", ">=", "MAX_SYMBOLIC_LINK_DEPTH", ")", "{", "throw", "new", "I...
Returns the directory entry located by the target path of the given symbolic link, resolved relative to the given directory.
[ "Returns", "the", "directory", "entry", "located", "by", "the", "target", "path", "of", "the", "given", "symbolic", "link", "resolved", "relative", "to", "the", "given", "directory", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileTree.java#L180-L188
111,729
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/SystemJimfsFileSystemProvider.java
SystemJimfsFileSystemProvider.isValidFileSystemUri
private static boolean isValidFileSystemUri(URI uri) { // would like to just check null, but fragment appears to be the empty string when not present return isNullOrEmpty(uri.getPath()) && isNullOrEmpty(uri.getQuery()) && isNullOrEmpty(uri.getFragment()); }
java
private static boolean isValidFileSystemUri(URI uri) { // would like to just check null, but fragment appears to be the empty string when not present return isNullOrEmpty(uri.getPath()) && isNullOrEmpty(uri.getQuery()) && isNullOrEmpty(uri.getFragment()); }
[ "private", "static", "boolean", "isValidFileSystemUri", "(", "URI", "uri", ")", "{", "// would like to just check null, but fragment appears to be the empty string when not present", "return", "isNullOrEmpty", "(", "uri", ".", "getPath", "(", ")", ")", "&&", "isNullOrEmpty", ...
Returns whether or not the given URI is valid as a base file system URI. It must not have a path, query or fragment.
[ "Returns", "whether", "or", "not", "the", "given", "URI", "is", "valid", "as", "a", "base", "file", "system", "URI", ".", "It", "must", "not", "have", "a", "path", "query", "or", "fragment", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/SystemJimfsFileSystemProvider.java#L150-L155
111,730
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/SystemJimfsFileSystemProvider.java
SystemJimfsFileSystemProvider.toFileSystemUri
private static URI toFileSystemUri(URI uri) { try { return new URI( uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), null, null, null); } catch (URISyntaxException e) { throw new AssertionError(e); } }
java
private static URI toFileSystemUri(URI uri) { try { return new URI( uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), null, null, null); } catch (URISyntaxException e) { throw new AssertionError(e); } }
[ "private", "static", "URI", "toFileSystemUri", "(", "URI", "uri", ")", "{", "try", "{", "return", "new", "URI", "(", "uri", ".", "getScheme", "(", ")", ",", "uri", ".", "getUserInfo", "(", ")", ",", "uri", ".", "getHost", "(", ")", ",", "uri", ".",...
Returns the given URI with any path, query or fragment stripped off.
[ "Returns", "the", "given", "URI", "with", "any", "path", "query", "or", "fragment", "stripped", "off", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/SystemJimfsFileSystemProvider.java#L158-L165
111,731
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/SystemJimfsFileSystemProvider.java
SystemJimfsFileSystemProvider.removeFileSystemRunnable
@SuppressWarnings("unused") // called via reflection public static Runnable removeFileSystemRunnable(final URI uri) { return new Runnable() { @Override public void run() { fileSystems.remove(uri); } }; }
java
@SuppressWarnings("unused") // called via reflection public static Runnable removeFileSystemRunnable(final URI uri) { return new Runnable() { @Override public void run() { fileSystems.remove(uri); } }; }
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "// called via reflection", "public", "static", "Runnable", "removeFileSystemRunnable", "(", "final", "URI", "uri", ")", "{", "return", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "...
Returns a runnable that, when run, removes the file system with the given URI from this provider.
[ "Returns", "a", "runnable", "that", "when", "run", "removes", "the", "file", "system", "with", "the", "given", "URI", "from", "this", "provider", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/SystemJimfsFileSystemProvider.java#L192-L200
111,732
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/JimfsFileSystems.java
JimfsFileSystems.newFileSystem
public static JimfsFileSystem newFileSystem( JimfsFileSystemProvider provider, URI uri, Configuration config) throws IOException { PathService pathService = new PathService(config); FileSystemState state = new FileSystemState(removeFileSystemRunnable(uri)); JimfsFileStore fileStore = createFileStore(...
java
public static JimfsFileSystem newFileSystem( JimfsFileSystemProvider provider, URI uri, Configuration config) throws IOException { PathService pathService = new PathService(config); FileSystemState state = new FileSystemState(removeFileSystemRunnable(uri)); JimfsFileStore fileStore = createFileStore(...
[ "public", "static", "JimfsFileSystem", "newFileSystem", "(", "JimfsFileSystemProvider", "provider", ",", "URI", "uri", ",", "Configuration", "config", ")", "throws", "IOException", "{", "PathService", "pathService", "=", "new", "PathService", "(", "config", ")", ";"...
Initialize and configure a new file system with the given provider and URI, using the given configuration.
[ "Initialize", "and", "configure", "a", "new", "file", "system", "with", "the", "given", "provider", "and", "URI", "using", "the", "given", "configuration", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileSystems.java#L68-L82
111,733
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/JimfsFileSystems.java
JimfsFileSystems.createFileStore
private static JimfsFileStore createFileStore( Configuration config, PathService pathService, FileSystemState state) { AttributeService attributeService = new AttributeService(config); // TODO(cgdecker): Make disk values configurable HeapDisk disk = new HeapDisk(config); FileFactory fileFactory =...
java
private static JimfsFileStore createFileStore( Configuration config, PathService pathService, FileSystemState state) { AttributeService attributeService = new AttributeService(config); // TODO(cgdecker): Make disk values configurable HeapDisk disk = new HeapDisk(config); FileFactory fileFactory =...
[ "private", "static", "JimfsFileStore", "createFileStore", "(", "Configuration", "config", ",", "PathService", "pathService", ",", "FileSystemState", "state", ")", "{", "AttributeService", "attributeService", "=", "new", "AttributeService", "(", "config", ")", ";", "//...
Creates the file store for the file system.
[ "Creates", "the", "file", "store", "for", "the", "file", "system", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileSystems.java#L85-L111
111,734
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/JimfsFileSystems.java
JimfsFileSystems.createDefaultView
private static FileSystemView createDefaultView( Configuration config, JimfsFileStore fileStore, PathService pathService) throws IOException { JimfsPath workingDirPath = pathService.parsePath(config.workingDirectory); Directory dir = fileStore.getRoot(workingDirPath.root()); if (dir == null) { ...
java
private static FileSystemView createDefaultView( Configuration config, JimfsFileStore fileStore, PathService pathService) throws IOException { JimfsPath workingDirPath = pathService.parsePath(config.workingDirectory); Directory dir = fileStore.getRoot(workingDirPath.root()); if (dir == null) { ...
[ "private", "static", "FileSystemView", "createDefaultView", "(", "Configuration", "config", ",", "JimfsFileStore", "fileStore", ",", "PathService", "pathService", ")", "throws", "IOException", "{", "JimfsPath", "workingDirPath", "=", "pathService", ".", "parsePath", "("...
Creates the default view of the file system using the given working directory.
[ "Creates", "the", "default", "view", "of", "the", "file", "system", "using", "the", "given", "working", "directory", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileSystems.java#L114-L132
111,735
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/HeapDisk.java
HeapDisk.allocate
public synchronized void allocate(RegularFile file, int count) throws IOException { int newAllocatedBlockCount = allocatedBlockCount + count; if (newAllocatedBlockCount > maxBlockCount) { throw new IOException("out of disk space"); } int newBlocksNeeded = Math.max(count - blockCache.blockCount(),...
java
public synchronized void allocate(RegularFile file, int count) throws IOException { int newAllocatedBlockCount = allocatedBlockCount + count; if (newAllocatedBlockCount > maxBlockCount) { throw new IOException("out of disk space"); } int newBlocksNeeded = Math.max(count - blockCache.blockCount(),...
[ "public", "synchronized", "void", "allocate", "(", "RegularFile", "file", ",", "int", "count", ")", "throws", "IOException", "{", "int", "newAllocatedBlockCount", "=", "allocatedBlockCount", "+", "count", ";", "if", "(", "newAllocatedBlockCount", ">", "maxBlockCount...
Allocates the given number of blocks and adds them to the given file.
[ "Allocates", "the", "given", "number", "of", "blocks", "and", "adds", "them", "to", "the", "given", "file", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/HeapDisk.java#L111-L128
111,736
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/Options.java
Options.getOptionsForChannel
public static ImmutableSet<OpenOption> getOptionsForChannel(Set<? extends OpenOption> options) { if (options.isEmpty()) { return DEFAULT_READ; } boolean append = options.contains(APPEND); boolean write = append || options.contains(WRITE); boolean read = !write || options.contains(READ); ...
java
public static ImmutableSet<OpenOption> getOptionsForChannel(Set<? extends OpenOption> options) { if (options.isEmpty()) { return DEFAULT_READ; } boolean append = options.contains(APPEND); boolean write = append || options.contains(WRITE); boolean read = !write || options.contains(READ); ...
[ "public", "static", "ImmutableSet", "<", "OpenOption", ">", "getOptionsForChannel", "(", "Set", "<", "?", "extends", "OpenOption", ">", "options", ")", "{", "if", "(", "options", ".", "isEmpty", "(", ")", ")", "{", "return", "DEFAULT_READ", ";", "}", "bool...
Returns an immutable set of open options for opening a new file channel.
[ "Returns", "an", "immutable", "set", "of", "open", "options", "for", "opening", "a", "new", "file", "channel", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/Options.java#L67-L92
111,737
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/Options.java
Options.getOptionsForInputStream
@SuppressWarnings("unchecked") // safe covariant cast public static ImmutableSet<OpenOption> getOptionsForInputStream(OpenOption... options) { boolean nofollowLinks = false; for (OpenOption option : options) { if (checkNotNull(option) != READ) { if (option == LinkOption.NOFOLLOW_LINKS) { ...
java
@SuppressWarnings("unchecked") // safe covariant cast public static ImmutableSet<OpenOption> getOptionsForInputStream(OpenOption... options) { boolean nofollowLinks = false; for (OpenOption option : options) { if (checkNotNull(option) != READ) { if (option == LinkOption.NOFOLLOW_LINKS) { ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "// safe covariant cast", "public", "static", "ImmutableSet", "<", "OpenOption", ">", "getOptionsForInputStream", "(", "OpenOption", "...", "options", ")", "{", "boolean", "nofollowLinks", "=", "false", ";", "for", ...
Returns an immutable set of open options for opening a new input stream.
[ "Returns", "an", "immutable", "set", "of", "open", "options", "for", "opening", "a", "new", "input", "stream", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/Options.java#L95-L111
111,738
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/Options.java
Options.getOptionsForOutputStream
public static ImmutableSet<OpenOption> getOptionsForOutputStream(OpenOption... options) { if (options.length == 0) { return DEFAULT_WRITE; } ImmutableSet<OpenOption> result = addWrite(Arrays.asList(options)); if (result.contains(READ)) { throw new UnsupportedOperationException("'READ' not a...
java
public static ImmutableSet<OpenOption> getOptionsForOutputStream(OpenOption... options) { if (options.length == 0) { return DEFAULT_WRITE; } ImmutableSet<OpenOption> result = addWrite(Arrays.asList(options)); if (result.contains(READ)) { throw new UnsupportedOperationException("'READ' not a...
[ "public", "static", "ImmutableSet", "<", "OpenOption", ">", "getOptionsForOutputStream", "(", "OpenOption", "...", "options", ")", "{", "if", "(", "options", ".", "length", "==", "0", ")", "{", "return", "DEFAULT_WRITE", ";", "}", "ImmutableSet", "<", "OpenOpt...
Returns an immutable set of open options for opening a new output stream.
[ "Returns", "an", "immutable", "set", "of", "open", "options", "for", "opening", "a", "new", "output", "stream", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/Options.java#L114-L124
111,739
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/Options.java
Options.getMoveOptions
public static ImmutableSet<CopyOption> getMoveOptions(CopyOption... options) { return ImmutableSet.copyOf(Lists.asList(LinkOption.NOFOLLOW_LINKS, options)); }
java
public static ImmutableSet<CopyOption> getMoveOptions(CopyOption... options) { return ImmutableSet.copyOf(Lists.asList(LinkOption.NOFOLLOW_LINKS, options)); }
[ "public", "static", "ImmutableSet", "<", "CopyOption", ">", "getMoveOptions", "(", "CopyOption", "...", "options", ")", "{", "return", "ImmutableSet", ".", "copyOf", "(", "Lists", ".", "asList", "(", "LinkOption", ".", "NOFOLLOW_LINKS", ",", "options", ")", ")...
Returns an immutable set of the given options for a move.
[ "Returns", "an", "immutable", "set", "of", "the", "given", "options", "for", "a", "move", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/Options.java#L137-L139
111,740
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/Options.java
Options.getCopyOptions
public static ImmutableSet<CopyOption> getCopyOptions(CopyOption... options) { ImmutableSet<CopyOption> result = ImmutableSet.copyOf(options); if (result.contains(ATOMIC_MOVE)) { throw new UnsupportedOperationException("'ATOMIC_MOVE' not allowed"); } return result; }
java
public static ImmutableSet<CopyOption> getCopyOptions(CopyOption... options) { ImmutableSet<CopyOption> result = ImmutableSet.copyOf(options); if (result.contains(ATOMIC_MOVE)) { throw new UnsupportedOperationException("'ATOMIC_MOVE' not allowed"); } return result; }
[ "public", "static", "ImmutableSet", "<", "CopyOption", ">", "getCopyOptions", "(", "CopyOption", "...", "options", ")", "{", "ImmutableSet", "<", "CopyOption", ">", "result", "=", "ImmutableSet", ".", "copyOf", "(", "options", ")", ";", "if", "(", "result", ...
Returns an immutable set of the given options for a copy.
[ "Returns", "an", "immutable", "set", "of", "the", "given", "options", "for", "a", "copy", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/Options.java#L142-L148
111,741
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/GlobToRegex.java
GlobToRegex.appendNormal
private void appendNormal(char c) { if (REGEX_RESERVED.matches(c)) { builder.append('\\'); } builder.append(c); }
java
private void appendNormal(char c) { if (REGEX_RESERVED.matches(c)) { builder.append('\\'); } builder.append(c); }
[ "private", "void", "appendNormal", "(", "char", "c", ")", "{", "if", "(", "REGEX_RESERVED", ".", "matches", "(", "c", ")", ")", "{", "builder", ".", "append", "(", "'", "'", ")", ";", "}", "builder", ".", "append", "(", "c", ")", ";", "}" ]
Appends the regex form of the given normal character from the glob.
[ "Appends", "the", "regex", "form", "of", "the", "given", "normal", "character", "from", "the", "glob", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/GlobToRegex.java#L120-L125
111,742
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/GlobToRegex.java
GlobToRegex.appendSeparator
private void appendSeparator() { if (separators.length() == 1) { appendNormal(separators.charAt(0)); } else { builder.append('['); for (int i = 0; i < separators.length(); i++) { appendInBracket(separators.charAt(i)); } builder.append("]"); } }
java
private void appendSeparator() { if (separators.length() == 1) { appendNormal(separators.charAt(0)); } else { builder.append('['); for (int i = 0; i < separators.length(); i++) { appendInBracket(separators.charAt(i)); } builder.append("]"); } }
[ "private", "void", "appendSeparator", "(", ")", "{", "if", "(", "separators", ".", "length", "(", ")", "==", "1", ")", "{", "appendNormal", "(", "separators", ".", "charAt", "(", "0", ")", ")", ";", "}", "else", "{", "builder", ".", "append", "(", ...
Appends the regex form matching the separators for the path type.
[ "Appends", "the", "regex", "form", "matching", "the", "separators", "for", "the", "path", "type", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/GlobToRegex.java#L128-L138
111,743
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/GlobToRegex.java
GlobToRegex.appendNonSeparator
private void appendNonSeparator() { builder.append("[^"); for (int i = 0; i < separators.length(); i++) { appendInBracket(separators.charAt(i)); } builder.append(']'); }
java
private void appendNonSeparator() { builder.append("[^"); for (int i = 0; i < separators.length(); i++) { appendInBracket(separators.charAt(i)); } builder.append(']'); }
[ "private", "void", "appendNonSeparator", "(", ")", "{", "builder", ".", "append", "(", "\"[^\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "separators", ".", "length", "(", ")", ";", "i", "++", ")", "{", "appendInBracket", "(", "se...
Appends the regex form that matches anything except the separators for the path type.
[ "Appends", "the", "regex", "form", "that", "matches", "anything", "except", "the", "separators", "for", "the", "path", "type", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/GlobToRegex.java#L141-L147
111,744
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/PathType.java
PathType.toUri
public final URI toUri( URI fileSystemUri, String root, Iterable<String> names, boolean directory) { String path = toUriPath(root, names, directory); try { // it should not suck this much to create a new URI that's the same except with a path set =( // need to do it this way for automatic path...
java
public final URI toUri( URI fileSystemUri, String root, Iterable<String> names, boolean directory) { String path = toUriPath(root, names, directory); try { // it should not suck this much to create a new URI that's the same except with a path set =( // need to do it this way for automatic path...
[ "public", "final", "URI", "toUri", "(", "URI", "fileSystemUri", ",", "String", "root", ",", "Iterable", "<", "String", ">", "names", ",", "boolean", "directory", ")", "{", "String", "path", "=", "toUriPath", "(", "root", ",", "names", ",", "directory", "...
Creates a URI for the path with the given root and names in the file system with the given URI.
[ "Creates", "a", "URI", "for", "the", "path", "with", "the", "given", "root", "and", "names", "in", "the", "file", "system", "with", "the", "given", "URI", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/PathType.java#L187-L204
111,745
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/JimfsFileSystem.java
JimfsFileSystem.toUri
public URI toUri(JimfsPath path) { fileStore.state().checkOpen(); return pathService.toUri(uri, path.toAbsolutePath()); }
java
public URI toUri(JimfsPath path) { fileStore.state().checkOpen(); return pathService.toUri(uri, path.toAbsolutePath()); }
[ "public", "URI", "toUri", "(", "JimfsPath", "path", ")", "{", "fileStore", ".", "state", "(", ")", ".", "checkOpen", "(", ")", ";", "return", "pathService", ".", "toUri", "(", "uri", ",", "path", ".", "toAbsolutePath", "(", ")", ")", ";", "}" ]
Gets the URI of the given path in this file system.
[ "Gets", "the", "URI", "of", "the", "given", "path", "in", "this", "file", "system", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileSystem.java#L260-L263
111,746
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/JimfsFileSystem.java
JimfsFileSystem.toPath
public JimfsPath toPath(URI uri) { fileStore.state().checkOpen(); return pathService.fromUri(uri); }
java
public JimfsPath toPath(URI uri) { fileStore.state().checkOpen(); return pathService.fromUri(uri); }
[ "public", "JimfsPath", "toPath", "(", "URI", "uri", ")", "{", "fileStore", ".", "state", "(", ")", ".", "checkOpen", "(", ")", ";", "return", "pathService", ".", "fromUri", "(", "uri", ")", ";", "}" ]
Converts the given URI into a path in this file system.
[ "Converts", "the", "given", "URI", "into", "a", "path", "in", "this", "file", "system", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileSystem.java#L266-L269
111,747
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/PathMatchers.java
PathMatchers.getPathMatcher
public static PathMatcher getPathMatcher( String syntaxAndPattern, String separators, ImmutableSet<PathNormalization> normalizations) { int syntaxSeparator = syntaxAndPattern.indexOf(':'); checkArgument( syntaxSeparator > 0, "Must be of the form 'syntax:pattern': %s", syntaxAndPattern); Strin...
java
public static PathMatcher getPathMatcher( String syntaxAndPattern, String separators, ImmutableSet<PathNormalization> normalizations) { int syntaxSeparator = syntaxAndPattern.indexOf(':'); checkArgument( syntaxSeparator > 0, "Must be of the form 'syntax:pattern': %s", syntaxAndPattern); Strin...
[ "public", "static", "PathMatcher", "getPathMatcher", "(", "String", "syntaxAndPattern", ",", "String", "separators", ",", "ImmutableSet", "<", "PathNormalization", ">", "normalizations", ")", "{", "int", "syntaxSeparator", "=", "syntaxAndPattern", ".", "indexOf", "(",...
Perhaps so, assuming Path always canonicalizes its separators
[ "Perhaps", "so", "assuming", "Path", "always", "canonicalizes", "its", "separators" ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/PathMatchers.java#L49-L67
111,748
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java
JimfsPath.startsWith
private static boolean startsWith(List<?> list, List<?> other) { return list.size() >= other.size() && list.subList(0, other.size()).equals(other); }
java
private static boolean startsWith(List<?> list, List<?> other) { return list.size() >= other.size() && list.subList(0, other.size()).equals(other); }
[ "private", "static", "boolean", "startsWith", "(", "List", "<", "?", ">", "list", ",", "List", "<", "?", ">", "other", ")", "{", "return", "list", ".", "size", "(", ")", ">=", "other", ".", "size", "(", ")", "&&", "list", ".", "subList", "(", "0"...
Returns true if list starts with all elements of other in the same order.
[ "Returns", "true", "if", "list", "starts", "with", "all", "elements", "of", "other", "in", "the", "same", "order", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java#L163-L165
111,749
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java
JimfsPath.isNormal
private boolean isNormal() { if (getNameCount() == 0 || (getNameCount() == 1 && !isAbsolute())) { return true; } boolean foundNonParentName = isAbsolute(); // if there's a root, the path doesn't start with .. boolean normal = true; for (Name name : names) { if (name.equals(Name.PARENT))...
java
private boolean isNormal() { if (getNameCount() == 0 || (getNameCount() == 1 && !isAbsolute())) { return true; } boolean foundNonParentName = isAbsolute(); // if there's a root, the path doesn't start with .. boolean normal = true; for (Name name : names) { if (name.equals(Name.PARENT))...
[ "private", "boolean", "isNormal", "(", ")", "{", "if", "(", "getNameCount", "(", ")", "==", "0", "||", "(", "getNameCount", "(", ")", "==", "1", "&&", "!", "isAbsolute", "(", ")", ")", ")", "{", "return", "true", ";", "}", "boolean", "foundNonParentN...
Returns whether or not this path is in a normalized form. It's normal if it both contains no "." names and contains no ".." names in a location other than the start of the path.
[ "Returns", "whether", "or", "not", "this", "path", "is", "in", "a", "normalized", "form", ".", "It", "s", "normal", "if", "it", "both", "contains", "no", ".", "names", "and", "contains", "no", "..", "names", "in", "a", "location", "other", "than", "the...
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java#L227-L250
111,750
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java
JimfsPath.resolve
JimfsPath resolve(Name name) { if (name.toString().isEmpty()) { return this; } return pathService.createPathInternal( root, ImmutableList.<Name>builder().addAll(names).add(name).build()); }
java
JimfsPath resolve(Name name) { if (name.toString().isEmpty()) { return this; } return pathService.createPathInternal( root, ImmutableList.<Name>builder().addAll(names).add(name).build()); }
[ "JimfsPath", "resolve", "(", "Name", "name", ")", "{", "if", "(", "name", ".", "toString", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", "this", ";", "}", "return", "pathService", ".", "createPathInternal", "(", "root", ",", "ImmutableList", ...
Resolves the given name against this path. The name is assumed not to be a root name.
[ "Resolves", "the", "given", "name", "against", "this", "path", ".", "The", "name", "is", "assumed", "not", "to", "be", "a", "root", "name", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java#L253-L259
111,751
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/PathService.java
PathService.emptyPath
public JimfsPath emptyPath() { JimfsPath result = emptyPath; if (result == null) { // use createPathInternal to avoid recursive call from createPath() result = createPathInternal(null, ImmutableList.of(Name.EMPTY)); emptyPath = result; return result; } return result; }
java
public JimfsPath emptyPath() { JimfsPath result = emptyPath; if (result == null) { // use createPathInternal to avoid recursive call from createPath() result = createPathInternal(null, ImmutableList.of(Name.EMPTY)); emptyPath = result; return result; } return result; }
[ "public", "JimfsPath", "emptyPath", "(", ")", "{", "JimfsPath", "result", "=", "emptyPath", ";", "if", "(", "result", "==", "null", ")", "{", "// use createPathInternal to avoid recursive call from createPath()", "result", "=", "createPathInternal", "(", "null", ",", ...
Returns an empty path which has a single name, the empty string.
[ "Returns", "an", "empty", "path", "which", "has", "a", "single", "name", "the", "empty", "string", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/PathService.java#L112-L121
111,752
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/PathService.java
PathService.createRoot
public JimfsPath createRoot(Name root) { return createPath(checkNotNull(root), ImmutableList.<Name>of()); }
java
public JimfsPath createRoot(Name root) { return createPath(checkNotNull(root), ImmutableList.<Name>of()); }
[ "public", "JimfsPath", "createRoot", "(", "Name", "root", ")", "{", "return", "createPath", "(", "checkNotNull", "(", "root", ")", ",", "ImmutableList", ".", "<", "Name", ">", "of", "(", ")", ")", ";", "}" ]
Returns a root path with the given name.
[ "Returns", "a", "root", "path", "with", "the", "given", "name", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/PathService.java#L150-L152
111,753
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/PathService.java
PathService.createRelativePath
public JimfsPath createRelativePath(Iterable<Name> names) { return createPath(null, ImmutableList.copyOf(names)); }
java
public JimfsPath createRelativePath(Iterable<Name> names) { return createPath(null, ImmutableList.copyOf(names)); }
[ "public", "JimfsPath", "createRelativePath", "(", "Iterable", "<", "Name", ">", "names", ")", "{", "return", "createPath", "(", "null", ",", "ImmutableList", ".", "copyOf", "(", "names", ")", ")", ";", "}" ]
Returns a relative path with the given names.
[ "Returns", "a", "relative", "path", "with", "the", "given", "names", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/PathService.java#L160-L162
111,754
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/PathService.java
PathService.parsePath
public JimfsPath parsePath(String first, String... more) { String joined = type.joiner().join(Iterables.filter(Lists.asList(first, more), NOT_EMPTY)); return toPath(type.parsePath(joined)); }
java
public JimfsPath parsePath(String first, String... more) { String joined = type.joiner().join(Iterables.filter(Lists.asList(first, more), NOT_EMPTY)); return toPath(type.parsePath(joined)); }
[ "public", "JimfsPath", "parsePath", "(", "String", "first", ",", "String", "...", "more", ")", "{", "String", "joined", "=", "type", ".", "joiner", "(", ")", ".", "join", "(", "Iterables", ".", "filter", "(", "Lists", ".", "asList", "(", "first", ",", ...
Parses the given strings as a path.
[ "Parses", "the", "given", "strings", "as", "a", "path", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/PathService.java#L181-L184
111,755
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/PathService.java
PathService.hash
public int hash(JimfsPath path) { int hash = 31; hash = 31 * hash + getFileSystem().hashCode(); final Name root = path.root(); final ImmutableList<Name> names = path.names(); if (equalityUsesCanonicalForm) { // use hash codes of names themselves, which are based on the canonical form h...
java
public int hash(JimfsPath path) { int hash = 31; hash = 31 * hash + getFileSystem().hashCode(); final Name root = path.root(); final ImmutableList<Name> names = path.names(); if (equalityUsesCanonicalForm) { // use hash codes of names themselves, which are based on the canonical form h...
[ "public", "int", "hash", "(", "JimfsPath", "path", ")", "{", "int", "hash", "=", "31", ";", "hash", "=", "31", "*", "hash", "+", "getFileSystem", "(", ")", ".", "hashCode", "(", ")", ";", "final", "Name", "root", "=", "path", ".", "root", "(", ")...
Creates a hash code for the given path.
[ "Creates", "a", "hash", "code", "for", "the", "given", "path", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/PathService.java#L201-L222
111,756
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/PathService.java
PathService.toUri
public URI toUri(URI fileSystemUri, JimfsPath path) { checkArgument(path.isAbsolute(), "path (%s) must be absolute", path); String root = String.valueOf(path.root()); Iterable<String> names = Iterables.transform(path.names(), Functions.toStringFunction()); return type.toUri(fileSystemUri, root, names, F...
java
public URI toUri(URI fileSystemUri, JimfsPath path) { checkArgument(path.isAbsolute(), "path (%s) must be absolute", path); String root = String.valueOf(path.root()); Iterable<String> names = Iterables.transform(path.names(), Functions.toStringFunction()); return type.toUri(fileSystemUri, root, names, F...
[ "public", "URI", "toUri", "(", "URI", "fileSystemUri", ",", "JimfsPath", "path", ")", "{", "checkArgument", "(", "path", ".", "isAbsolute", "(", ")", ",", "\"path (%s) must be absolute\"", ",", "path", ")", ";", "String", "root", "=", "String", ".", "valueOf...
Returns the URI for the given path. The given file system URI is the base against which the path is resolved to create the returned URI.
[ "Returns", "the", "URI", "for", "the", "given", "path", ".", "The", "given", "file", "system", "URI", "is", "the", "base", "against", "which", "the", "path", "is", "resolved", "to", "create", "the", "returned", "URI", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/PathService.java#L236-L241
111,757
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/Directory.java
Directory.get
@Nullable public DirectoryEntry get(Name name) { int index = bucketIndex(name, table.length); DirectoryEntry entry = table[index]; while (entry != null) { if (name.equals(entry.name())) { return entry; } entry = entry.next; } return null; }
java
@Nullable public DirectoryEntry get(Name name) { int index = bucketIndex(name, table.length); DirectoryEntry entry = table[index]; while (entry != null) { if (name.equals(entry.name())) { return entry; } entry = entry.next; } return null; }
[ "@", "Nullable", "public", "DirectoryEntry", "get", "(", "Name", "name", ")", "{", "int", "index", "=", "bucketIndex", "(", "name", ",", "table", ".", "length", ")", ";", "DirectoryEntry", "entry", "=", "table", "[", "index", "]", ";", "while", "(", "e...
Returns the entry for the given name in this table or null if no such entry exists.
[ "Returns", "the", "entry", "for", "the", "given", "name", "in", "this", "table", "or", "null", "if", "no", "such", "entry", "exists", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/Directory.java#L106-L119
111,758
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/Directory.java
Directory.link
public void link(Name name, File file) { DirectoryEntry entry = new DirectoryEntry(this, checkNotReserved(name, "link"), file); put(entry); file.linked(entry); }
java
public void link(Name name, File file) { DirectoryEntry entry = new DirectoryEntry(this, checkNotReserved(name, "link"), file); put(entry); file.linked(entry); }
[ "public", "void", "link", "(", "Name", "name", ",", "File", "file", ")", "{", "DirectoryEntry", "entry", "=", "new", "DirectoryEntry", "(", "this", ",", "checkNotReserved", "(", "name", ",", "\"link\"", ")", ",", "file", ")", ";", "put", "(", "entry", ...
Links the given name to the given file in this directory. @throws IllegalArgumentException if {@code name} is a reserved name such as "." or if an entry already exists for the name
[ "Links", "the", "given", "name", "to", "the", "given", "file", "in", "this", "directory", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/Directory.java#L127-L131
111,759
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/Directory.java
Directory.unlink
public void unlink(Name name) { DirectoryEntry entry = remove(checkNotReserved(name, "unlink")); entry.file().unlinked(); }
java
public void unlink(Name name) { DirectoryEntry entry = remove(checkNotReserved(name, "unlink")); entry.file().unlinked(); }
[ "public", "void", "unlink", "(", "Name", "name", ")", "{", "DirectoryEntry", "entry", "=", "remove", "(", "checkNotReserved", "(", "name", ",", "\"unlink\"", ")", ")", ";", "entry", ".", "file", "(", ")", ".", "unlinked", "(", ")", ";", "}" ]
Unlinks the given name from the file it is linked to. @throws IllegalArgumentException if {@code name} is a reserved name such as "." or no entry exists for the name
[ "Unlinks", "the", "given", "name", "from", "the", "file", "it", "is", "linked", "to", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/Directory.java#L139-L142
111,760
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/Directory.java
Directory.snapshot
public ImmutableSortedSet<Name> snapshot() { ImmutableSortedSet.Builder<Name> builder = new ImmutableSortedSet.Builder<>(Name.displayOrdering()); for (DirectoryEntry entry : this) { if (!isReserved(entry.name())) { builder.add(entry.name()); } } return builder.build(); }
java
public ImmutableSortedSet<Name> snapshot() { ImmutableSortedSet.Builder<Name> builder = new ImmutableSortedSet.Builder<>(Name.displayOrdering()); for (DirectoryEntry entry : this) { if (!isReserved(entry.name())) { builder.add(entry.name()); } } return builder.build(); }
[ "public", "ImmutableSortedSet", "<", "Name", ">", "snapshot", "(", ")", "{", "ImmutableSortedSet", ".", "Builder", "<", "Name", ">", "builder", "=", "new", "ImmutableSortedSet", ".", "Builder", "<>", "(", "Name", ".", "displayOrdering", "(", ")", ")", ";", ...
Creates an immutable sorted snapshot of the names this directory contains, excluding "." and "..".
[ "Creates", "an", "immutable", "sorted", "snapshot", "of", "the", "names", "this", "directory", "contains", "excluding", ".", "and", "..", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/Directory.java#L148-L159
111,761
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/DirectoryEntry.java
DirectoryEntry.requireDirectory
public DirectoryEntry requireDirectory(Path pathForException) throws NoSuchFileException, NotDirectoryException { requireExists(pathForException); if (!file().isDirectory()) { throw new NotDirectoryException(pathForException.toString()); } return this; }
java
public DirectoryEntry requireDirectory(Path pathForException) throws NoSuchFileException, NotDirectoryException { requireExists(pathForException); if (!file().isDirectory()) { throw new NotDirectoryException(pathForException.toString()); } return this; }
[ "public", "DirectoryEntry", "requireDirectory", "(", "Path", "pathForException", ")", "throws", "NoSuchFileException", ",", "NotDirectoryException", "{", "requireExists", "(", "pathForException", ")", ";", "if", "(", "!", "file", "(", ")", ".", "isDirectory", "(", ...
Checks that this entry exists and links to a directory, throwing an exception if not. @return this @throws NoSuchFileException if this entry does not exist @throws NotDirectoryException if this entry does not link to a directory
[ "Checks", "that", "this", "entry", "exists", "and", "links", "to", "a", "directory", "throwing", "an", "exception", "if", "not", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/DirectoryEntry.java#L92-L99
111,762
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/DirectoryEntry.java
DirectoryEntry.requireSymbolicLink
public DirectoryEntry requireSymbolicLink(Path pathForException) throws NoSuchFileException, NotLinkException { requireExists(pathForException); if (!file().isSymbolicLink()) { throw new NotLinkException(pathForException.toString()); } return this; }
java
public DirectoryEntry requireSymbolicLink(Path pathForException) throws NoSuchFileException, NotLinkException { requireExists(pathForException); if (!file().isSymbolicLink()) { throw new NotLinkException(pathForException.toString()); } return this; }
[ "public", "DirectoryEntry", "requireSymbolicLink", "(", "Path", "pathForException", ")", "throws", "NoSuchFileException", ",", "NotLinkException", "{", "requireExists", "(", "pathForException", ")", ";", "if", "(", "!", "file", "(", ")", ".", "isSymbolicLink", "(", ...
Checks that this entry exists and links to a symbolic link, throwing an exception if not. @return this @throws NoSuchFileException if this entry does not exist @throws NotLinkException if this entry does not link to a symbolic link
[ "Checks", "that", "this", "entry", "exists", "and", "links", "to", "a", "symbolic", "link", "throwing", "an", "exception", "if", "not", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/DirectoryEntry.java#L108-L115
111,763
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/JimfsAsynchronousFileChannel.java
JimfsAsynchronousFileChannel.closedChannelFuture
private static <V> ListenableFuture<V> closedChannelFuture() { SettableFuture<V> future = SettableFuture.create(); future.setException(new ClosedChannelException()); return future; }
java
private static <V> ListenableFuture<V> closedChannelFuture() { SettableFuture<V> future = SettableFuture.create(); future.setException(new ClosedChannelException()); return future; }
[ "private", "static", "<", "V", ">", "ListenableFuture", "<", "V", ">", "closedChannelFuture", "(", ")", "{", "SettableFuture", "<", "V", ">", "future", "=", "SettableFuture", ".", "create", "(", ")", ";", "future", ".", "setException", "(", "new", "ClosedC...
Immediate future indicating that the channel is closed.
[ "Immediate", "future", "indicating", "that", "the", "channel", "is", "closed", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsAsynchronousFileChannel.java#L181-L185
111,764
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/Jimfs.java
Jimfs.newFileSystem
public static FileSystem newFileSystem(String name, Configuration configuration) { try { URI uri = new URI(URI_SCHEME, name, null, null); return newFileSystem(uri, configuration); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } }
java
public static FileSystem newFileSystem(String name, Configuration configuration) { try { URI uri = new URI(URI_SCHEME, name, null, null); return newFileSystem(uri, configuration); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } }
[ "public", "static", "FileSystem", "newFileSystem", "(", "String", "name", ",", "Configuration", "configuration", ")", "{", "try", "{", "URI", "uri", "=", "new", "URI", "(", "URI_SCHEME", ",", "name", ",", "null", ",", "null", ")", ";", "return", "newFileSy...
Creates a new in-memory file system with the given configuration. <p>The returned file system uses the given name as the host part of its URI and the URIs of paths in the file system. For example, given the name {@code my-file-system}, the file system's URI will be {@code jimfs://my-file-system} and the URI of the pat...
[ "Creates", "a", "new", "in", "-", "memory", "file", "system", "with", "the", "given", "configuration", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/Jimfs.java#L130-L137
111,765
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/File.java
File.getAttributeNames
public final synchronized ImmutableSet<String> getAttributeNames(String view) { if (attributes == null) { return ImmutableSet.of(); } return ImmutableSet.copyOf(attributes.row(view).keySet()); }
java
public final synchronized ImmutableSet<String> getAttributeNames(String view) { if (attributes == null) { return ImmutableSet.of(); } return ImmutableSet.copyOf(attributes.row(view).keySet()); }
[ "public", "final", "synchronized", "ImmutableSet", "<", "String", ">", "getAttributeNames", "(", "String", "view", ")", "{", "if", "(", "attributes", "==", "null", ")", "{", "return", "ImmutableSet", ".", "of", "(", ")", ";", "}", "return", "ImmutableSet", ...
Returns the names of the attributes contained in the given attribute view in the file's attributes table.
[ "Returns", "the", "names", "of", "the", "attributes", "contained", "in", "the", "given", "attribute", "view", "in", "the", "file", "s", "attributes", "table", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/File.java#L204-L209
111,766
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/File.java
File.getAttributeKeys
@VisibleForTesting final synchronized ImmutableSet<String> getAttributeKeys() { if (attributes == null) { return ImmutableSet.of(); } ImmutableSet.Builder<String> builder = ImmutableSet.builder(); for (Table.Cell<String, String, Object> cell : attributes.cellSet()) { builder.add(cell.getR...
java
@VisibleForTesting final synchronized ImmutableSet<String> getAttributeKeys() { if (attributes == null) { return ImmutableSet.of(); } ImmutableSet.Builder<String> builder = ImmutableSet.builder(); for (Table.Cell<String, String, Object> cell : attributes.cellSet()) { builder.add(cell.getR...
[ "@", "VisibleForTesting", "final", "synchronized", "ImmutableSet", "<", "String", ">", "getAttributeKeys", "(", ")", "{", "if", "(", "attributes", "==", "null", ")", "{", "return", "ImmutableSet", ".", "of", "(", ")", ";", "}", "ImmutableSet", ".", "Builder"...
Returns the attribute keys contained in the attributes map for the file.
[ "Returns", "the", "attribute", "keys", "contained", "in", "the", "attributes", "map", "for", "the", "file", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/File.java#L212-L223
111,767
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/File.java
File.getAttribute
@Nullable public final synchronized Object getAttribute(String view, String attribute) { if (attributes == null) { return null; } return attributes.get(view, attribute); }
java
@Nullable public final synchronized Object getAttribute(String view, String attribute) { if (attributes == null) { return null; } return attributes.get(view, attribute); }
[ "@", "Nullable", "public", "final", "synchronized", "Object", "getAttribute", "(", "String", "view", ",", "String", "attribute", ")", "{", "if", "(", "attributes", "==", "null", ")", "{", "return", "null", ";", "}", "return", "attributes", ".", "get", "(",...
Gets the value of the given attribute in the given view.
[ "Gets", "the", "value", "of", "the", "given", "attribute", "in", "the", "given", "view", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/File.java#L226-L232
111,768
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/File.java
File.setAttribute
public final synchronized void setAttribute(String view, String attribute, Object value) { if (attributes == null) { attributes = HashBasedTable.create(); } attributes.put(view, attribute, value); }
java
public final synchronized void setAttribute(String view, String attribute, Object value) { if (attributes == null) { attributes = HashBasedTable.create(); } attributes.put(view, attribute, value); }
[ "public", "final", "synchronized", "void", "setAttribute", "(", "String", "view", ",", "String", "attribute", ",", "Object", "value", ")", "{", "if", "(", "attributes", "==", "null", ")", "{", "attributes", "=", "HashBasedTable", ".", "create", "(", ")", "...
Sets the given attribute in the given view to the given value.
[ "Sets", "the", "given", "attribute", "in", "the", "given", "view", "to", "the", "given", "value", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/File.java#L235-L240
111,769
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/File.java
File.deleteAttribute
public final synchronized void deleteAttribute(String view, String attribute) { if (attributes != null) { attributes.remove(view, attribute); } }
java
public final synchronized void deleteAttribute(String view, String attribute) { if (attributes != null) { attributes.remove(view, attribute); } }
[ "public", "final", "synchronized", "void", "deleteAttribute", "(", "String", "view", ",", "String", "attribute", ")", "{", "if", "(", "attributes", "!=", "null", ")", "{", "attributes", ".", "remove", "(", "view", ",", "attribute", ")", ";", "}", "}" ]
Deletes the given attribute from the given view.
[ "Deletes", "the", "given", "attribute", "from", "the", "given", "view", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/File.java#L243-L247
111,770
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/AttributeProvider.java
AttributeProvider.unsettable
protected static RuntimeException unsettable(String view, String attribute, boolean create) { // This matches the behavior of the real file system implementations: if the attempt to set the // attribute is being made during file creation, throw UOE even though the attribute is one // that cannot be set unde...
java
protected static RuntimeException unsettable(String view, String attribute, boolean create) { // This matches the behavior of the real file system implementations: if the attempt to set the // attribute is being made during file creation, throw UOE even though the attribute is one // that cannot be set unde...
[ "protected", "static", "RuntimeException", "unsettable", "(", "String", "view", ",", "String", "attribute", ",", "boolean", "create", ")", "{", "// This matches the behavior of the real file system implementations: if the attempt to set the", "// attribute is being made during file c...
Throws a runtime exception indicating that the given attribute cannot be set.
[ "Throws", "a", "runtime", "exception", "indicating", "that", "the", "given", "attribute", "cannot", "be", "set", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/AttributeProvider.java#L129-L135
111,771
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/AttributeProvider.java
AttributeProvider.checkNotCreate
protected static void checkNotCreate(String view, String attribute, boolean create) { if (create) { throw new UnsupportedOperationException( "cannot set attribute '" + view + ":" + attribute + "' during file creation"); } }
java
protected static void checkNotCreate(String view, String attribute, boolean create) { if (create) { throw new UnsupportedOperationException( "cannot set attribute '" + view + ":" + attribute + "' during file creation"); } }
[ "protected", "static", "void", "checkNotCreate", "(", "String", "view", ",", "String", "attribute", ",", "boolean", "create", ")", "{", "if", "(", "create", ")", "{", "throw", "new", "UnsupportedOperationException", "(", "\"cannot set attribute '\"", "+", "view", ...
Checks that the attribute is not being set by the user on file creation, throwing an unsupported operation exception if it is.
[ "Checks", "that", "the", "attribute", "is", "not", "being", "set", "by", "the", "user", "on", "file", "creation", "throwing", "an", "unsupported", "operation", "exception", "if", "it", "is", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/AttributeProvider.java#L141-L146
111,772
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/AttributeProvider.java
AttributeProvider.checkType
protected static <T> T checkType(String view, String attribute, Object value, Class<T> type) { checkNotNull(value); if (type.isInstance(value)) { return type.cast(value); } throw invalidType(view, attribute, value, type); }
java
protected static <T> T checkType(String view, String attribute, Object value, Class<T> type) { checkNotNull(value); if (type.isInstance(value)) { return type.cast(value); } throw invalidType(view, attribute, value, type); }
[ "protected", "static", "<", "T", ">", "T", "checkType", "(", "String", "view", ",", "String", "attribute", ",", "Object", "value", ",", "Class", "<", "T", ">", "type", ")", "{", "checkNotNull", "(", "value", ")", ";", "if", "(", "type", ".", "isInsta...
Checks that the given value is of the given type, returning the value if so and throwing an exception if not.
[ "Checks", "that", "the", "given", "value", "is", "of", "the", "given", "type", "returning", "the", "value", "if", "so", "and", "throwing", "an", "exception", "if", "not", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/AttributeProvider.java#L152-L159
111,773
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/AttributeProvider.java
AttributeProvider.invalidType
protected static IllegalArgumentException invalidType( String view, String attribute, Object value, Class<?>... expectedTypes) { Object expected = expectedTypes.length == 1 ? expectedTypes[0] : "one of " + Arrays.toString(expectedTypes); throw new IllegalArgumentException( "invalid type " ...
java
protected static IllegalArgumentException invalidType( String view, String attribute, Object value, Class<?>... expectedTypes) { Object expected = expectedTypes.length == 1 ? expectedTypes[0] : "one of " + Arrays.toString(expectedTypes); throw new IllegalArgumentException( "invalid type " ...
[ "protected", "static", "IllegalArgumentException", "invalidType", "(", "String", "view", ",", "String", "attribute", ",", "Object", "value", ",", "Class", "<", "?", ">", "...", "expectedTypes", ")", "{", "Object", "expected", "=", "expectedTypes", ".", "length",...
Throws an illegal argument exception indicating that the given value is not one of the expected types for the given attribute.
[ "Throws", "an", "illegal", "argument", "exception", "indicating", "that", "the", "given", "value", "is", "not", "one", "of", "the", "expected", "types", "for", "the", "given", "attribute", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/AttributeProvider.java#L165-L178
111,774
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/WindowsPathType.java
WindowsPathType.parseUncRoot
private String parseUncRoot(String path, String original) { Matcher uncMatcher = UNC_ROOT.matcher(path); if (uncMatcher.find()) { String host = uncMatcher.group(2); if (host == null) { throw new InvalidPathException(original, "UNC path is missing hostname"); } String share = uncM...
java
private String parseUncRoot(String path, String original) { Matcher uncMatcher = UNC_ROOT.matcher(path); if (uncMatcher.find()) { String host = uncMatcher.group(2); if (host == null) { throw new InvalidPathException(original, "UNC path is missing hostname"); } String share = uncM...
[ "private", "String", "parseUncRoot", "(", "String", "path", ",", "String", "original", ")", "{", "Matcher", "uncMatcher", "=", "UNC_ROOT", ".", "matcher", "(", "path", ")", ";", "if", "(", "uncMatcher", ".", "find", "(", ")", ")", "{", "String", "host", ...
Parse the root of a UNC-style path, throwing an exception if the path does not start with a valid UNC root.
[ "Parse", "the", "root", "of", "a", "UNC", "-", "style", "path", "throwing", "an", "exception", "if", "the", "path", "does", "not", "start", "with", "a", "valid", "UNC", "root", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/WindowsPathType.java#L114-L131
111,775
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/JimfsFileChannel.java
JimfsFileChannel.endBlocking
private void endBlocking(boolean completed) throws AsynchronousCloseException { synchronized (blockingThreads) { blockingThreads.remove(Thread.currentThread()); } end(completed); }
java
private void endBlocking(boolean completed) throws AsynchronousCloseException { synchronized (blockingThreads) { blockingThreads.remove(Thread.currentThread()); } end(completed); }
[ "private", "void", "endBlocking", "(", "boolean", "completed", ")", "throws", "AsynchronousCloseException", "{", "synchronized", "(", "blockingThreads", ")", "{", "blockingThreads", ".", "remove", "(", "Thread", ".", "currentThread", "(", ")", ")", ";", "}", "en...
Ends a blocking operation, throwing an exception if the thread was interrupted while blocking or if the channel was closed from another thread.
[ "Ends", "a", "blocking", "operation", "throwing", "an", "exception", "if", "the", "thread", "was", "interrupted", "while", "blocking", "or", "if", "the", "channel", "was", "closed", "from", "another", "thread", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileChannel.java#L135-L140
111,776
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/Name.java
Name.simple
@VisibleForTesting static Name simple(String name) { switch (name) { case ".": return SELF; case "..": return PARENT; default: return new Name(name, name); } }
java
@VisibleForTesting static Name simple(String name) { switch (name) { case ".": return SELF; case "..": return PARENT; default: return new Name(name, name); } }
[ "@", "VisibleForTesting", "static", "Name", "simple", "(", "String", "name", ")", "{", "switch", "(", "name", ")", "{", "case", "\".\"", ":", "return", "SELF", ";", "case", "\"..\"", ":", "return", "PARENT", ";", "default", ":", "return", "new", "Name", ...
Creates a new name with no normalization done on the given string.
[ "Creates", "a", "new", "name", "with", "no", "normalization", "done", "on", "the", "given", "string", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/Name.java#L52-L62
111,777
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/RegularFile.java
RegularFile.expandIfNecessary
private void expandIfNecessary(int minBlockCount) { if (minBlockCount > blocks.length) { this.blocks = Arrays.copyOf(blocks, nextPowerOf2(minBlockCount)); } }
java
private void expandIfNecessary(int minBlockCount) { if (minBlockCount > blocks.length) { this.blocks = Arrays.copyOf(blocks, nextPowerOf2(minBlockCount)); } }
[ "private", "void", "expandIfNecessary", "(", "int", "minBlockCount", ")", "{", "if", "(", "minBlockCount", ">", "blocks", ".", "length", ")", "{", "this", ".", "blocks", "=", "Arrays", ".", "copyOf", "(", "blocks", ",", "nextPowerOf2", "(", "minBlockCount", ...
lower-level methods dealing with the blocks array
[ "lower", "-", "level", "methods", "dealing", "with", "the", "blocks", "array" ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L85-L89
111,778
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/RegularFile.java
RegularFile.prepareForWrite
private void prepareForWrite(long pos, long len) throws IOException { long end = pos + len; // allocate any additional blocks needed int lastBlockIndex = blockCount - 1; int endBlockIndex = blockIndex(end - 1); if (endBlockIndex > lastBlockIndex) { int additionalBlocksNeeded = endBlockIndex ...
java
private void prepareForWrite(long pos, long len) throws IOException { long end = pos + len; // allocate any additional blocks needed int lastBlockIndex = blockCount - 1; int endBlockIndex = blockIndex(end - 1); if (endBlockIndex > lastBlockIndex) { int additionalBlocksNeeded = endBlockIndex ...
[ "private", "void", "prepareForWrite", "(", "long", "pos", ",", "long", "len", ")", "throws", "IOException", "{", "long", "end", "=", "pos", "+", "len", ";", "// allocate any additional blocks needed", "int", "lastBlockIndex", "=", "blockCount", "-", "1", ";", ...
Prepares for a write of len bytes starting at position pos.
[ "Prepares", "for", "a", "write", "of", "len", "bytes", "starting", "at", "position", "pos", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L238-L268
111,779
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/RegularFile.java
RegularFile.blockForWrite
private byte[] blockForWrite(int index) throws IOException { if (index >= blockCount) { int additionalBlocksNeeded = index - blockCount + 1; disk.allocate(this, additionalBlocksNeeded); } return blocks[index]; }
java
private byte[] blockForWrite(int index) throws IOException { if (index >= blockCount) { int additionalBlocksNeeded = index - blockCount + 1; disk.allocate(this, additionalBlocksNeeded); } return blocks[index]; }
[ "private", "byte", "[", "]", "blockForWrite", "(", "int", "index", ")", "throws", "IOException", "{", "if", "(", "index", ">=", "blockCount", ")", "{", "int", "additionalBlocksNeeded", "=", "index", "-", "blockCount", "+", "1", ";", "disk", ".", "allocate"...
Gets the block at the given index, expanding to create the block if necessary.
[ "Gets", "the", "block", "at", "the", "given", "index", "expanding", "to", "create", "the", "block", "if", "necessary", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L591-L598
111,780
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/RegularFile.java
RegularFile.zero
private static int zero(byte[] block, int offset, int len) { Util.zero(block, offset, len); return len; }
java
private static int zero(byte[] block, int offset, int len) { Util.zero(block, offset, len); return len; }
[ "private", "static", "int", "zero", "(", "byte", "[", "]", "block", ",", "int", "offset", ",", "int", "len", ")", "{", "Util", ".", "zero", "(", "block", ",", "offset", ",", "len", ")", ";", "return", "len", ";", "}" ]
Zeroes len bytes in the given block starting at the given offset. Returns len.
[ "Zeroes", "len", "bytes", "in", "the", "given", "block", "starting", "at", "the", "given", "offset", ".", "Returns", "len", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L629-L632
111,781
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/RegularFile.java
RegularFile.put
private static int put(byte[] block, int offset, byte[] b, int off, int len) { System.arraycopy(b, off, block, offset, len); return len; }
java
private static int put(byte[] block, int offset, byte[] b, int off, int len) { System.arraycopy(b, off, block, offset, len); return len; }
[ "private", "static", "int", "put", "(", "byte", "[", "]", "block", ",", "int", "offset", ",", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "{", "System", ".", "arraycopy", "(", "b", ",", "off", ",", "block", ",", "offset", ...
Puts the given slice of the given array at the given offset in the given block.
[ "Puts", "the", "given", "slice", "of", "the", "given", "array", "at", "the", "given", "offset", "in", "the", "given", "block", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L635-L638
111,782
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/RegularFile.java
RegularFile.put
private static int put(byte[] block, int offset, ByteBuffer buf) { int len = Math.min(block.length - offset, buf.remaining()); buf.get(block, offset, len); return len; }
java
private static int put(byte[] block, int offset, ByteBuffer buf) { int len = Math.min(block.length - offset, buf.remaining()); buf.get(block, offset, len); return len; }
[ "private", "static", "int", "put", "(", "byte", "[", "]", "block", ",", "int", "offset", ",", "ByteBuffer", "buf", ")", "{", "int", "len", "=", "Math", ".", "min", "(", "block", ".", "length", "-", "offset", ",", "buf", ".", "remaining", "(", ")", ...
Puts the contents of the given byte buffer at the given offset in the given block.
[ "Puts", "the", "contents", "of", "the", "given", "byte", "buffer", "at", "the", "given", "offset", "in", "the", "given", "block", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L641-L645
111,783
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/RegularFile.java
RegularFile.get
private static int get(byte[] block, int offset, byte[] b, int off, int len) { System.arraycopy(block, offset, b, off, len); return len; }
java
private static int get(byte[] block, int offset, byte[] b, int off, int len) { System.arraycopy(block, offset, b, off, len); return len; }
[ "private", "static", "int", "get", "(", "byte", "[", "]", "block", ",", "int", "offset", ",", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "{", "System", ".", "arraycopy", "(", "block", ",", "offset", ",", "b", ",", "off", ...
Reads len bytes starting at the given offset in the given block into the given slice of the given byte array.
[ "Reads", "len", "bytes", "starting", "at", "the", "given", "offset", "in", "the", "given", "block", "into", "the", "given", "slice", "of", "the", "given", "byte", "array", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L651-L654
111,784
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/RegularFile.java
RegularFile.get
private static int get(byte[] block, int offset, ByteBuffer buf, int len) { buf.put(block, offset, len); return len; }
java
private static int get(byte[] block, int offset, ByteBuffer buf, int len) { buf.put(block, offset, len); return len; }
[ "private", "static", "int", "get", "(", "byte", "[", "]", "block", ",", "int", "offset", ",", "ByteBuffer", "buf", ",", "int", "len", ")", "{", "buf", ".", "put", "(", "block", ",", "offset", ",", "len", ")", ";", "return", "len", ";", "}" ]
Reads len bytes starting at the given offset in the given block into the given byte buffer.
[ "Reads", "len", "bytes", "starting", "at", "the", "given", "offset", "in", "the", "given", "block", "into", "the", "given", "byte", "buffer", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L657-L660
111,785
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileSystemState.java
FileSystemState.register
public <C extends Closeable> C register(C resource) { // Initial open check to avoid incrementing registering if we already know it's closed. // This is to prevent any possibility of a weird pathalogical situation where the do/while // loop in close() keeps looping as register() is called repeatedly from mu...
java
public <C extends Closeable> C register(C resource) { // Initial open check to avoid incrementing registering if we already know it's closed. // This is to prevent any possibility of a weird pathalogical situation where the do/while // loop in close() keeps looping as register() is called repeatedly from mu...
[ "public", "<", "C", "extends", "Closeable", ">", "C", "register", "(", "C", "resource", ")", "{", "// Initial open check to avoid incrementing registering if we already know it's closed.", "// This is to prevent any possibility of a weird pathalogical situation where the do/while", "//...
Registers the given resource to be closed when the file system is closed. Should be called when the resource is opened.
[ "Registers", "the", "given", "resource", "to", "be", "closed", "when", "the", "file", "system", "is", "closed", ".", "Should", "be", "called", "when", "the", "resource", "is", "opened", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemState.java#L69-L86
111,786
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/Util.java
Util.nextPowerOf2
public static int nextPowerOf2(int n) { if (n == 0) { return 1; } int b = Integer.highestOneBit(n); return b == n ? n : b << 1; }
java
public static int nextPowerOf2(int n) { if (n == 0) { return 1; } int b = Integer.highestOneBit(n); return b == n ? n : b << 1; }
[ "public", "static", "int", "nextPowerOf2", "(", "int", "n", ")", "{", "if", "(", "n", "==", "0", ")", "{", "return", "1", ";", "}", "int", "b", "=", "Integer", ".", "highestOneBit", "(", "n", ")", ";", "return", "b", "==", "n", "?", "n", ":", ...
Returns the next power of 2 >= n.
[ "Returns", "the", "next", "power", "of", "2", ">", "=", "n", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/Util.java#L35-L41
111,787
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/Util.java
Util.checkNoneNull
static void checkNoneNull(Iterable<?> objects) { if (!(objects instanceof ImmutableCollection)) { for (Object o : objects) { checkNotNull(o); } } }
java
static void checkNoneNull(Iterable<?> objects) { if (!(objects instanceof ImmutableCollection)) { for (Object o : objects) { checkNotNull(o); } } }
[ "static", "void", "checkNoneNull", "(", "Iterable", "<", "?", ">", "objects", ")", "{", "if", "(", "!", "(", "objects", "instanceof", "ImmutableCollection", ")", ")", "{", "for", "(", "Object", "o", ":", "objects", ")", "{", "checkNotNull", "(", "o", "...
Checks that no element in the given iterable is null, throwing NPE if any is.
[ "Checks", "that", "no", "element", "in", "the", "given", "iterable", "is", "null", "throwing", "NPE", "if", "any", "is", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/Util.java#L52-L58
111,788
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java
FileSystemView.lookUpWithLock
DirectoryEntry lookUpWithLock(JimfsPath path, Set<? super LinkOption> options) throws IOException { store.readLock().lock(); try { return lookUp(path, options); } finally { store.readLock().unlock(); } }
java
DirectoryEntry lookUpWithLock(JimfsPath path, Set<? super LinkOption> options) throws IOException { store.readLock().lock(); try { return lookUp(path, options); } finally { store.readLock().unlock(); } }
[ "DirectoryEntry", "lookUpWithLock", "(", "JimfsPath", "path", ",", "Set", "<", "?", "super", "LinkOption", ">", "options", ")", "throws", "IOException", "{", "store", ".", "readLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "return", "lookUp", ...
Attempt to look up the file at the given path.
[ "Attempt", "to", "look", "up", "the", "file", "at", "the", "given", "path", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L98-L106
111,789
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java
FileSystemView.lookUp
private DirectoryEntry lookUp(JimfsPath path, Set<? super LinkOption> options) throws IOException { return store.lookUp(workingDirectory, path, options); }
java
private DirectoryEntry lookUp(JimfsPath path, Set<? super LinkOption> options) throws IOException { return store.lookUp(workingDirectory, path, options); }
[ "private", "DirectoryEntry", "lookUp", "(", "JimfsPath", "path", ",", "Set", "<", "?", "super", "LinkOption", ">", "options", ")", "throws", "IOException", "{", "return", "store", ".", "lookUp", "(", "workingDirectory", ",", "path", ",", "options", ")", ";",...
Looks up the file at the given path without locking.
[ "Looks", "up", "the", "file", "at", "the", "given", "path", "without", "locking", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L109-L112
111,790
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java
FileSystemView.snapshotWorkingDirectoryEntries
public ImmutableSortedSet<Name> snapshotWorkingDirectoryEntries() { store.readLock().lock(); try { ImmutableSortedSet<Name> names = workingDirectory.snapshot(); workingDirectory.updateAccessTime(); return names; } finally { store.readLock().unlock(); } }
java
public ImmutableSortedSet<Name> snapshotWorkingDirectoryEntries() { store.readLock().lock(); try { ImmutableSortedSet<Name> names = workingDirectory.snapshot(); workingDirectory.updateAccessTime(); return names; } finally { store.readLock().unlock(); } }
[ "public", "ImmutableSortedSet", "<", "Name", ">", "snapshotWorkingDirectoryEntries", "(", ")", "{", "store", ".", "readLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "ImmutableSortedSet", "<", "Name", ">", "names", "=", "workingDirectory", ".", "sn...
Snapshots the entries of the working directory of this view.
[ "Snapshots", "the", "entries", "of", "the", "working", "directory", "of", "this", "view", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L134-L143
111,791
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java
FileSystemView.snapshotModifiedTimes
public ImmutableMap<Name, Long> snapshotModifiedTimes(JimfsPath path) throws IOException { ImmutableMap.Builder<Name, Long> modifiedTimes = ImmutableMap.builder(); store.readLock().lock(); try { Directory dir = (Directory) lookUp(path, Options.FOLLOW_LINKS).requireDirectory(path).file(); // TOD...
java
public ImmutableMap<Name, Long> snapshotModifiedTimes(JimfsPath path) throws IOException { ImmutableMap.Builder<Name, Long> modifiedTimes = ImmutableMap.builder(); store.readLock().lock(); try { Directory dir = (Directory) lookUp(path, Options.FOLLOW_LINKS).requireDirectory(path).file(); // TOD...
[ "public", "ImmutableMap", "<", "Name", ",", "Long", ">", "snapshotModifiedTimes", "(", "JimfsPath", "path", ")", "throws", "IOException", "{", "ImmutableMap", ".", "Builder", "<", "Name", ",", "Long", ">", "modifiedTimes", "=", "ImmutableMap", ".", "builder", ...
Returns a snapshot mapping the names of each file in the directory at the given path to the last modified time of that file.
[ "Returns", "a", "snapshot", "mapping", "the", "names", "of", "each", "file", "in", "the", "directory", "at", "the", "given", "path", "to", "the", "last", "modified", "time", "of", "that", "file", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L149-L169
111,792
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java
FileSystemView.isSameFile
public boolean isSameFile(JimfsPath path, FileSystemView view2, JimfsPath path2) throws IOException { if (!isSameFileSystem(view2)) { return false; } store.readLock().lock(); try { File file = lookUp(path, Options.FOLLOW_LINKS).fileOrNull(); File file2 = view2.lookUp(path2, Opti...
java
public boolean isSameFile(JimfsPath path, FileSystemView view2, JimfsPath path2) throws IOException { if (!isSameFileSystem(view2)) { return false; } store.readLock().lock(); try { File file = lookUp(path, Options.FOLLOW_LINKS).fileOrNull(); File file2 = view2.lookUp(path2, Opti...
[ "public", "boolean", "isSameFile", "(", "JimfsPath", "path", ",", "FileSystemView", "view2", ",", "JimfsPath", "path2", ")", "throws", "IOException", "{", "if", "(", "!", "isSameFileSystem", "(", "view2", ")", ")", "{", "return", "false", ";", "}", "store", ...
Returns whether or not the two given paths locate the same file. The second path is located using the given view rather than this file view.
[ "Returns", "whether", "or", "not", "the", "two", "given", "paths", "locate", "the", "same", "file", ".", "The", "second", "path", "is", "located", "using", "the", "given", "view", "rather", "than", "this", "file", "view", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L175-L189
111,793
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java
FileSystemView.createDirectory
public Directory createDirectory(JimfsPath path, FileAttribute<?>... attrs) throws IOException { return (Directory) createFile(path, store.directoryCreator(), true, attrs); }
java
public Directory createDirectory(JimfsPath path, FileAttribute<?>... attrs) throws IOException { return (Directory) createFile(path, store.directoryCreator(), true, attrs); }
[ "public", "Directory", "createDirectory", "(", "JimfsPath", "path", ",", "FileAttribute", "<", "?", ">", "...", "attrs", ")", "throws", "IOException", "{", "return", "(", "Directory", ")", "createFile", "(", "path", ",", "store", ".", "directoryCreator", "(", ...
Creates a new directory at the given path. The given attributes will be set on the new file if possible.
[ "Creates", "a", "new", "directory", "at", "the", "given", "path", ".", "The", "given", "attributes", "will", "be", "set", "on", "the", "new", "file", "if", "possible", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L224-L226
111,794
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java
FileSystemView.createSymbolicLink
public SymbolicLink createSymbolicLink( JimfsPath path, JimfsPath target, FileAttribute<?>... attrs) throws IOException { if (!store.supportsFeature(Feature.SYMBOLIC_LINKS)) { throw new UnsupportedOperationException(); } return (SymbolicLink) createFile(path, store.symbolicLinkCreator(target), t...
java
public SymbolicLink createSymbolicLink( JimfsPath path, JimfsPath target, FileAttribute<?>... attrs) throws IOException { if (!store.supportsFeature(Feature.SYMBOLIC_LINKS)) { throw new UnsupportedOperationException(); } return (SymbolicLink) createFile(path, store.symbolicLinkCreator(target), t...
[ "public", "SymbolicLink", "createSymbolicLink", "(", "JimfsPath", "path", ",", "JimfsPath", "target", ",", "FileAttribute", "<", "?", ">", "...", "attrs", ")", "throws", "IOException", "{", "if", "(", "!", "store", ".", "supportsFeature", "(", "Feature", ".", ...
Creates a new symbolic link at the given path with the given target. The given attributes will be set on the new file if possible.
[ "Creates", "a", "new", "symbolic", "link", "at", "the", "given", "path", "with", "the", "given", "target", ".", "The", "given", "attributes", "will", "be", "set", "on", "the", "new", "file", "if", "possible", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L232-L238
111,795
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java
FileSystemView.getOrCreateRegularFile
public RegularFile getOrCreateRegularFile( JimfsPath path, Set<OpenOption> options, FileAttribute<?>... attrs) throws IOException { checkNotNull(path); if (!options.contains(CREATE_NEW)) { // assume file exists unless we're explicitly trying to create a new file RegularFile file = lookUpRegul...
java
public RegularFile getOrCreateRegularFile( JimfsPath path, Set<OpenOption> options, FileAttribute<?>... attrs) throws IOException { checkNotNull(path); if (!options.contains(CREATE_NEW)) { // assume file exists unless we're explicitly trying to create a new file RegularFile file = lookUpRegul...
[ "public", "RegularFile", "getOrCreateRegularFile", "(", "JimfsPath", "path", ",", "Set", "<", "OpenOption", ">", "options", ",", "FileAttribute", "<", "?", ">", "...", "attrs", ")", "throws", "IOException", "{", "checkNotNull", "(", "path", ")", ";", "if", "...
Gets the regular file at the given path, creating it if it doesn't exist and the given options specify that it should be created.
[ "Gets", "the", "regular", "file", "at", "the", "given", "path", "creating", "it", "if", "it", "doesn", "t", "exist", "and", "the", "given", "options", "specify", "that", "it", "should", "be", "created", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L285-L302
111,796
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java
FileSystemView.lookUpRegularFile
@Nullable private RegularFile lookUpRegularFile(JimfsPath path, Set<OpenOption> options) throws IOException { store.readLock().lock(); try { DirectoryEntry entry = lookUp(path, options); if (entry.exists()) { File file = entry.file(); if (!file.isRegularFile()) { th...
java
@Nullable private RegularFile lookUpRegularFile(JimfsPath path, Set<OpenOption> options) throws IOException { store.readLock().lock(); try { DirectoryEntry entry = lookUp(path, options); if (entry.exists()) { File file = entry.file(); if (!file.isRegularFile()) { th...
[ "@", "Nullable", "private", "RegularFile", "lookUpRegularFile", "(", "JimfsPath", "path", ",", "Set", "<", "OpenOption", ">", "options", ")", "throws", "IOException", "{", "store", ".", "readLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "Directo...
Looks up the regular file at the given path, throwing an exception if the file isn't a regular file. Returns null if the file did not exist.
[ "Looks", "up", "the", "regular", "file", "at", "the", "given", "path", "throwing", "an", "exception", "if", "the", "file", "isn", "t", "a", "regular", "file", ".", "Returns", "null", "if", "the", "file", "did", "not", "exist", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L308-L326
111,797
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java
FileSystemView.open
private static RegularFile open(RegularFile file, Set<OpenOption> options) { if (options.contains(TRUNCATE_EXISTING) && options.contains(WRITE)) { file.writeLock().lock(); try { file.truncate(0); } finally { file.writeLock().unlock(); } } // must be opened while hold...
java
private static RegularFile open(RegularFile file, Set<OpenOption> options) { if (options.contains(TRUNCATE_EXISTING) && options.contains(WRITE)) { file.writeLock().lock(); try { file.truncate(0); } finally { file.writeLock().unlock(); } } // must be opened while hold...
[ "private", "static", "RegularFile", "open", "(", "RegularFile", "file", ",", "Set", "<", "OpenOption", ">", "options", ")", "{", "if", "(", "options", ".", "contains", "(", "TRUNCATE_EXISTING", ")", "&&", "options", ".", "contains", "(", "WRITE", ")", ")",...
Opens the given regular file with the given options, truncating it if necessary and incrementing its open count. Returns the given file.
[ "Opens", "the", "given", "regular", "file", "with", "the", "given", "options", "truncating", "it", "if", "necessary", "and", "incrementing", "its", "open", "count", ".", "Returns", "the", "given", "file", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L348-L363
111,798
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java
FileSystemView.readSymbolicLink
public JimfsPath readSymbolicLink(JimfsPath path) throws IOException { if (!store.supportsFeature(Feature.SYMBOLIC_LINKS)) { throw new UnsupportedOperationException(); } SymbolicLink symbolicLink = (SymbolicLink) lookUpWithLock(path, Options.NOFOLLOW_LINKS).requireSymbolicLink(pat...
java
public JimfsPath readSymbolicLink(JimfsPath path) throws IOException { if (!store.supportsFeature(Feature.SYMBOLIC_LINKS)) { throw new UnsupportedOperationException(); } SymbolicLink symbolicLink = (SymbolicLink) lookUpWithLock(path, Options.NOFOLLOW_LINKS).requireSymbolicLink(pat...
[ "public", "JimfsPath", "readSymbolicLink", "(", "JimfsPath", "path", ")", "throws", "IOException", "{", "if", "(", "!", "store", ".", "supportsFeature", "(", "Feature", ".", "SYMBOLIC_LINKS", ")", ")", "{", "throw", "new", "UnsupportedOperationException", "(", "...
Returns the target of the symbolic link at the given path.
[ "Returns", "the", "target", "of", "the", "symbolic", "link", "at", "the", "given", "path", "." ]
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L366-L376
111,799
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java
FileSystemView.checkAccess
public void checkAccess(JimfsPath path) throws IOException { // just check that the file exists lookUpWithLock(path, Options.FOLLOW_LINKS).requireExists(path); }
java
public void checkAccess(JimfsPath path) throws IOException { // just check that the file exists lookUpWithLock(path, Options.FOLLOW_LINKS).requireExists(path); }
[ "public", "void", "checkAccess", "(", "JimfsPath", "path", ")", "throws", "IOException", "{", "// just check that the file exists", "lookUpWithLock", "(", "path", ",", "Options", ".", "FOLLOW_LINKS", ")", ".", "requireExists", "(", "path", ")", ";", "}" ]
Checks access to the file at the given path for the given modes. Since access controls are not implemented for this file system, this just checks that the file exists.
[ "Checks", "access", "to", "the", "file", "at", "the", "given", "path", "for", "the", "given", "modes", ".", "Since", "access", "controls", "are", "not", "implemented", "for", "this", "file", "system", "this", "just", "checks", "that", "the", "file", "exist...
3eadff747a3afa7b498030f420d2d04ce700534a
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L382-L385