Examples of canWrite()


Examples of org.python.core.util.RelativeFile.canWrite()

            }
        } catch (FileNotFoundException fnfe) {
            if (absPath.isDirectory()) {
                throw Py.IOError(Errno.EISDIR, name);
            }
            if ((writing && !absPath.canWrite())
                || fnfe.getMessage().endsWith("(Permission denied)")) {
                throw Py.IOError(Errno.EACCES, name);
            }
            throw Py.IOError(Errno.ENOENT, name);
        }
View Full Code Here

Examples of org.renjin.primitives.io.connections.Connection.canWrite()

    boolean wasOpen = con.isOpen();
    if(!wasOpen) {
      con.open(new OpenSpec("wb"));
    }
   
    if(!con.canWrite()) {
      throw new EvalException("connection not open for writing");
    }
    if(ascii) {
      throw new EvalException("ascii serialization not implemented");
    }
View Full Code Here

Examples of org.springframework.expression.PropertyAccessor.canWrite()

  @Test
  public void accessingNullPropertyViaReflection_SPR5663() throws AccessException {
    PropertyAccessor propertyAccessor = new ReflectivePropertyAccessor();
    EvaluationContext context = TestScenarioCreator.getTestEvaluationContext();
    assertFalse(propertyAccessor.canRead(context, null, "abc"));
    assertFalse(propertyAccessor.canWrite(context, null, "abc"));
    try {
      propertyAccessor.read(context, null, "abc");
      fail("Should have failed with an AccessException");
    }
    catch (AccessException ae) {
View Full Code Here

Examples of org.springframework.expression.spel.support.ReflectivePropertyAccessor.canWrite()

  @Test
  public void accessingNullPropertyViaReflection_SPR5663() throws AccessException {
    PropertyAccessor propertyAccessor = new ReflectivePropertyAccessor();
    EvaluationContext context = TestScenarioCreator.getTestEvaluationContext();
    assertFalse(propertyAccessor.canRead(context, null, "abc"));
    assertFalse(propertyAccessor.canWrite(context, null, "abc"));
    try {
      propertyAccessor.read(context, null, "abc");
      fail("Should have failed with an AccessException");
    }
    catch (AccessException ae) {
View Full Code Here

Examples of org.springframework.http.converter.GenericHttpMessageConverter.canWrite()

    given(converter.canRead(intList.getType(), null, null)).willReturn(true);
    given(converter.getSupportedMediaTypes()).willReturn(Collections.singletonList(MediaType.TEXT_PLAIN));
    given(requestFactory.createRequest(new URI("http://example.com"), HttpMethod.POST)).willReturn(this.request);
    HttpHeaders requestHeaders = new HttpHeaders();
    given(this.request.getHeaders()).willReturn(requestHeaders);
    given(converter.canWrite(String.class, null)).willReturn(true);
    String requestBody = "Hello World";
    converter.write(requestBody, null, this.request);
    given(this.request.execute()).willReturn(response);
    given(errorHandler.hasError(response)).willReturn(false);
    HttpHeaders responseHeaders = new HttpHeaders();
View Full Code Here

Examples of org.terrier.utility.io.FileSystem.canWrite()

    if (fs == null)
      return false;
    if ((fs.capabilities() & (FSCapability.WRITE | FSCapability.STAT )) == 0)
      return false;
    try{
      return fs.canWrite(filename);
    } catch (IOException ioe) {
      return false;
    }
  }
View Full Code Here

Examples of org.voltdb.utils.VoltFile.canWrite()

                //m_errorString = "Provided path exists but is not readable: " + filePath;
                return null;
            }
        }

        if (!path.canWrite()) {
            if (!path.setWritable(true)) {
                //m_errorString = "Provided path exists but is not writable: " + filePath;
                return null;
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.