Object exists Excel API : ObjectExists
Interface Details
Endpoint
Copy GET http://api.aspose.cloud/v4 .0 /cells/storage/exist/{path}
Function Description
The request parameters of objectExists API are:
Parameter Name
Type
Path/Query String/HTTPBody
Description
path
String
Path
storageName
String
Query
versionId
String
Query
Response Description
Copy {
"Name" : "ObjectExist" ,
"Description" : [
"Object exists"
],
"Type" : "Class" ,
"IsAbstract" : false ,
"Properties" : [
{
"Name" : "Exists" ,
"Description" : [
"Indicates that the file or folder exists."
],
"Nullable" : true ,
"ReadOnly" : false ,
"IsInherit" : false ,
"DataType" : {
"Identifier" : "Boolean" ,
"Name" : "boolean"
}
},
{
"Name" : "IsFolder" ,
"Description" : [
"True if it is a folder, false if it is a file."
],
"Nullable" : true ,
"ReadOnly" : false ,
"IsInherit" : false ,
"DataType" : {
"Identifier" : "Boolean" ,
"Name" : "boolean"
}
}
]
}
OpenAPI Specification
The OpenAPI Specification defines a publicly accessible programming interface and lets you carry out REST interactions directly from a web browser.
Excel API SDK
Using an SDK is the best way to speed up the development. An SDK takes care of low-level details and lets you focus on your project tasks. Please check out the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to make calls to Aspose.Cells web services using various SDKs:
C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Aspose.Cells.Cloud.SDK.Api;
using Aspose.Cells.Cloud.SDK.Model;
using Aspose.Cells.Cloud.SDK.Request;
using System;
using System.IO;
using System.Collections.Generic;
using Range = Aspose.Cells.Cloud.SDK.Model.Range;
public static class Example40_ObjectExists
{
public static void Run()
{
CellsApi cellsApi = new CellsApi("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
string remoteFolder = "TestData/In";
string localName = "Book1.xlsx";
string remoteName = "Book1.xlsx";
var request = new ObjectExistsRequest(
path: "TestData/In/Book1.xlsx",
storageName: "",
versionId: ""
);
cellsApi.ObjectExists(request);
}
}
Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.aspose.cloud.cells.api;
import com.aspose.cloud.cells.client.*;
import com.aspose.cloud.cells.model.*;
import com.aspose.cloud.cells.request.*;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import java.io.File;
import java.util.HashMap;
public class ExampleObjectExists {
private CellsApi api;
public ExampleObjectExists(){
try {
api = new CellsApi(
System.getenv("CellsCloudClientId"),
System.getenv("CellsCloudClientSecret"),
"v3.0",
System.getenv("CellsCloudApiBaseUrl")
);
} catch (ApiException e) {
e.printStackTrace();
}
}
public void Run(){
try{
String remoteFolder = "TestData/In";
String localName = "Book1.xlsx";
String remoteName = "Book1.xlsx";
UploadFileRequest uploadFileRequest = new UploadFileRequest();
uploadFileRequest.setPath( remoteFolder + "/" + remoteName );
uploadFileRequest.setStorageName( "");
HashMap<String,File> files = new HashMap<String,File>();
files.put( localName , new File(localName ));
uploadFileRequest.setUploadFiles(files);
cellsApi.uploadFile(uploadFileRequest);
ObjectExistsRequest request = new ObjectExistsRequest();
request.setPath("TestData/In/Book1.xlsx");
request.setStorageName("");
request.setVersionId("");
this.api.objectExists(request);
} catch (ApiException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php
require_once('vendor\autoload.php');
use \Aspose\Cells\Cloud\Api\CellsApi;
use \Aspose\Cells\Cloud\Request\ObjectExistsRequest;
$cellsApi = new CellsApi(getenv("CellsCloudClientId"),getenv("CellsCloudClientSecret"),"v3.0",getenv("CellsCloudApiBaseUrl"));
$remoteFolder = "TestData/In";
$localName = "Book1.xlsx";
$remoteName = "Book1.xlsx";
CellsApiTestBase::ready( $this->instance,$localName ,$remoteFolder . "/" . $remoteName , "");
$request = new ObjectExistsRequest();
$request->setPath( "TestData/In/Book1.xlsx");
$request->setStorageName( "");
$request->setVersionId( "");
$$cellsApi->objectExists($request);
Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl'
require 'bundler'
require 'aspose_cells_cloud'
@instance = AsposeCellsCloud::CellsApi.new(ENV['CellsCloudClientId'], ENV['CellsCloudClientSecret'],'v3.0',ENV['CellsCloudApiBaseUrl'])
remote_folder = 'TestData/In'
local_name = 'Book1.xlsx'
remote_name = 'Book1.xlsx'
mapFiles = { }
mapFiles[local_name] = ::File.open(File.expand_path("TestData/"+local_name),"r")
uploadrequest = AsposeCellsCloud::UploadFileRequest.new( { :UploadFiles=>mapFiles,:path=>remote_folder })
@instance.upload_file(uploadrequest)
request = AsposeCellsCloud::ObjectExistsRequest.new(:path=>'TestData/In/Book1.xlsx',:storageName=>'',:versionId=>'');
@instance.object_exists(request);
Node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs');
var path = require('path');
const _ = require('asposecellscloud');
const cellsApi = new CellsApi(process.env.CellsCloudClientId, process.env.CellsCloudClientSecret,"v3.0",process.env.CellsCloudApiBaseUrl);
var remoteFolder = "TestData/In"
var localName = "Book1.xlsx"
var remoteName = "Book1.xlsx"
var localNameRequest = new model.UploadFileRequest();
localNameRequest.uploadFiles ={localName:fs.createReadStream(localPath + localName)};
localNameRequest.path = remoteFolder + "/" + remoteName ;
localNameRequest.storageName ="";
cellsApi.uploadFile(localNameRequest );
var request = new model.ObjectExistsRequest();
request.path = "TestData/In/Book1.xlsx";
request.storageName = "";
request.versionId = "";
return cellsApi.objectExists(request).then((result) => {
expect(result.response.statusCode).to.equal(200);
});
Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os
import sys
from asposecellscloud.apis.cells_api import CellsApi
from asposecellscloud.models import *
from asposecellscloud.requests import *
api = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'),"v3.0",os.getenv('CellsCloudApiBaseUrl'))
remote_folder = 'TestData/In'
local_name = 'Book1.xlsx'
remote_name = 'Book1.xlsx'
mapFiles = {
local_name: local_name
}
request = UploadFileRequest( mapFiles, remote_folder + '/' + remote_name,storage_name= '')
api.upload_file(request)
request = ObjectExistsRequest( 'TestData/In/Book1.xlsx',storage_name= '',version_id= '')
api.object_exists(request)
Perl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use lib 'lib';
use strict;
use warnings;
use File::Slurp;
use MIME::Base64;
use AsposeCellsCloud::CellsApi;
my $config = AsposeCellsCloud::Configuration->new( client_id => $ENV{'CellsCloudClientId'}, client_secret => $ENV{'CellsCloudClientSecret'});
my $instance = AsposeCellsCloud::CellsApi->new(AsposeCellsCloud::ApiClient->new( $config));
my $remoteFolder = 'TestData/In';
my $localName = 'Book1.xlsx';
my $remoteName = 'Book1.xlsx';
my $upload_file_request = AsposeCellsCloud::Request::UploadFileRequest->new( 'UploadFiles'=>{ $localName => $localName } ,'path'=>$remoteFolder . '/' . $remoteName );
my $request = AsposeCellsCloud::Request::ObjectExistsRequest->new();
$request->{path} = 'TestData/In/Book1.xlsx';
$request->{storage_name} = '';
$request->{version_id} = '';
$instance->object_exists(request=> $request);
Go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main
import (
"os"
asposecellscloud "github.com/aspose-cells-cloud/aspose-cells-cloud-go"
)
func main() {
instance := asposecellscloud.NewCellsApiService(os.Getenv("ProductClientId"), os.Getenv("ProductClientSecret"), "https://api.aspose.cloud", "v3.0")
remoteFolder := "TestData/In"
localName := "Book1.xlsx"
remoteName := "Book1.xlsx"
localNameRequest := new(asposecellscloud.UploadFileRequest)
localNameRequest.UploadFiles = make(map[string]string)
localNameRequest.UploadFiles[localName] = localName
localNameRequest.Path = remoteFolder + "/" + remoteName
localNameRequest.StorageName =""
instance.UploadFile(localNameRequest )
request := new (asposecellscloud.ObjectExistsRequest)
request.Path = "TestData/In/Book1.xlsx"
request.StorageName = ""
request.VersionId = ""
_, httpResponse, err := instance.ObjectExists(request)
if err != nil {
t.Error(err)
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
t.Fail()
}
}